Why this code doesn't compile and shows an error?

bsb

#1

I’m a newbie to Reason. Right now I’m following a course from Lynda.com.
The tutorial I’m following shows an example code which runs for the instructor, but when i use the same code it gives me an error.

I installed bs-platform using npm and the bsb -v command’s output is 7.2.2

Here is the code, which failed to compile with the error shown in the screenshot.


#2

And here is the code (exact same code) wrote by the instructor which compiled and ran.
(I couldn’t include both the screenshots in the question because of the restrictions as a new member to the forum)
Screenshot%20from%202020-03-14%2023-22-42


#3

Not sure why it worked at all (!)
But change the first line to read as follows:

let calcRewardPoints = (purchases) => {

and it should work fine.


#4

Thank you! :slight_smile: