Parsing error?? Export function gone wrong

Hello!
I am trying to recreate the example from this post: Velo Tutorial: Adding Multiple Items to the Cart in a Wix Stores Site | Help Center | Wix.com on my website. However, I keep getting a “parsing error: unexpected token export” on the following line:
export function SelectedCTFRepeater_itemReady($w, itemData, index) . This is supposed to be setting up each item in the selected repeater as it is loaded.
As I am not a trained programmer whatsoever, could you please explain what might have gone wrong and how I can solve this error?

Thank you in advance!

Hello

where are you adding this function? make sure it’s not used on the backend

and make sure of the syntax it should look as follows:

$w("#myRepeater").onItemReady( ($w, itemData, index) => {
  let repeatedElement = $item("#repeatedElement");
  let nonRepeatedElement = $item("#nonRepeatedElement");
  let itemDataValue = itemData.someProperty;
  let isEvenItem = index % 2 == 0;
});

check this link.

Best
Massa