Usage letis what causes this error inside strict mode. Change it to var. It looks like you are in en2015 env. Or you can convert your code with babel .
You also cannot define variables inside .jsx expressions. Define your array outside of the return statement and refer to it in the expression: let colours = ["green","yellow","red"]and then { colours }.
source
share