Control flow; !true vs false


This error message contradict itself and I do not know what to change here?


Hi inside you if statement you should put === isntaed of =



var programming = false
if (programming = !true){ // do something }


var programming = false
if (programming != true){ // do something }

option1, you assign (you use a single equal sign to assign) a value of !true (aka false), which means the condition is false, else will run

In option2, you compare if programming (which is false (you defined it the line above)) if it doesn't equal true. True does not equal false, the condition is true, the if statement will run. There is a huge difference where you put the exclamation mark