let machineActive = false;
In the above stmt, the default value of the machinActive is false?
if we use it in the if statements,
if(machineActive){}
In the above stmt, is machineActive set to true or false after its declaration as false?
Hello @vaishnavi_A.N
let machineActive = false;
this will set machineActive to false
the default value mean the value that a certain type have if it not to certain value so boolean is false int is 0 and so on but once you set a variable to certain value it has this value despite if it was the default value of it’s type or something else
if(machineActive){}
this check if machineActive
value is true or any non zero int if it any of those condition then what ever in between{}
will be executed it will not change the value of machineActive
unless if you change it between the {}
hope that help and have a nice day