I am new to react and also programming, I would like to know why am I seeing the parsing error while my code is quite simple and easy. How can I resolve this and if yes why am I seeing this? because I use other editor (online)it shows me correct expected result but on my local it shows error.
currentTime >= 1 && currentTime <12
You have to write out the entire comparison every single time and cannot write it like you would say it normally.
The program will check the comparisons first and then “&&” them → so it tries to check “<12” which is no valid syntax.
Seems like the implemented interpreter there is more forgiving.
But don’t get used to it.
When chaining conditions with && or || you should always have fully realized conditional statements on both sides.