+ 1
Syntax error: unexpected token
3 Réponses
+ 3
Xavier in a keyword using in js , that's why you are getting an error.
+ 2
let countries = [
"India",
"Japan",
"USA",
"United Kingdom",
"Singapore"
];
countries = {in: "India", uk: "United Kingdom"};
console.log(countries.in);
Try this
- 1
Xavier you should do the javascript course first
https://www.sololearn.com/Course/JavaScript/?ref=app
You will see that your code has multiple syntax errors.
- After let has to be a new identifier (name for variable)
- "in" and "uk" are undefined
- if in is only a value in a dictionary you can only access it via the dictionary
Maybe more, you should really just learn the correct syntax first