JS Illegal Character

Can't for the life of me figure this out.
const period = hours ≥ 12 ? "PM" : "AM";
const period = hours ≥ 12 ? "PM" : "AM";
I get "Uncaught SyntaxError: illegal character U+2265" Any suggestions? TIA
13 Replies
13eck
13eck13mo ago
My suggestion is to remove the illegal character and use proper syntax :p is not a valid operator in JS: you need to use the >= operator.
beforecomputers
beforecomputers13mo ago
Agreed
Andrew
AndrewOP13mo ago
Thank you. Thats what I have been reading about. Just wanted to make sure.
13eck
13eck13mo ago
👍
MarkBoots
MarkBoots13mo ago
another option (ignore, just for fun)
const period = 'AP'[~~(hours/12)]+'M'
const period = 'AP'[~~(hours/12)]+'M'
Andrew
AndrewOP13mo ago
const period = hours >= 12 ? "PM" : "AM";
const period = hours >= 12 ? "PM" : "AM";
Uncaught SyntaxError: expected expression, got '=>'
Jochem
Jochem13mo ago
It's >= not => If the snippet you pasted is accurate to what you have in your code, that error doesnt concern the code on that line.
Andrew
AndrewOP13mo ago
Ok the snippet is accurate...I will have to run through the js file and see whats going on elsewhere...Thanks!
Jochem
Jochem13mo ago
The error should contain a line and character number
Andrew
AndrewOP13mo ago
yes got that error corrected thanks! now I have another js file for the weather app with this error Uncaught SyntaxError: ambiguous indirect export: error404
Jochem
Jochem13mo ago
Without code, it's like gazing in a crystal ball. Also, generally we prefer one topic per post
Andrew
AndrewOP13mo ago
GitHub
GitHub - andrewteece/weatherio
Contribute to andrewteece/weatherio development by creating an account on GitHub.
Andrew
AndrewOP13mo ago
ok sorry I will do a new post
Want results from more Discord servers?
Add your server