I'm struggling to comprehend why utilizing a double equals (or even a triple equals) in the condition of a for loop doesn't function as expected. Consider this example:
for (i = 1; i == 5; i++){
console.log(i)
}
When I replace ==
with <=
, it works correctly and I can't figure out why.