Why when i write this code :
const myFirstVar = 1
const mySecondVar = 2
(myFirstVar === mySecondVar) ? "yes" : "no"
I get this error :
Uncaught ReferenceError: Cannot access 'mySecondVar' before initialization
While when i write this code :
const myFirstVar = 1
const mySecondVar = 2
myFirstVar === mySecondVar ? "yes" : "no"
It works ?