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
13eck12mo 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
beforecomputers12mo ago
Agreed
Andrew
AndrewOP12mo ago
Thank you. Thats what I have been reading about. Just wanted to make sure.
13eck
13eck12mo ago
👍
MarkBoots
MarkBoots12mo ago
another option (ignore, just for fun)
const period = 'AP'[~~(hours/12)]+'M'
const period = 'AP'[~~(hours/12)]+'M'
Andrew
AndrewOP12mo ago
const period = hours >= 12 ? "PM" : "AM";
const period = hours >= 12 ? "PM" : "AM";
Uncaught SyntaxError: expected expression, got '=>'
Jochem
Jochem12mo 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
AndrewOP12mo ago
Ok the snippet is accurate...I will have to run through the js file and see whats going on elsewhere...Thanks!
Jochem
Jochem12mo ago
The error should contain a line and character number
Andrew
AndrewOP12mo 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
Jochem12mo ago
Without code, it's like gazing in a crystal ball. Also, generally we prefer one topic per post
Andrew
AndrewOP12mo ago
GitHub
GitHub - andrewteece/weatherio
Contribute to andrewteece/weatherio development by creating an account on GitHub.
Andrew
AndrewOP12mo ago
ok sorry I will do a new post
Want results from more Discord servers?
Add your server