r/JavaScriptTips • • Apr 17 '23

Help

Post image

I’m working on a sample problem for ATA and I keep getting an “illegal parenthesized expression” error. Can someone tell me what I’m doing wrong and how can I fix it?

0 Upvotes

9 comments sorted by

View all comments

0

u/azronio Apr 17 '23

You don't initialize arrays like that in JS, use square brackets [0, 1, 2]. Curly braces to initialize an array is a different language syntax like C#.