Sunday, January 8, 2017

JavaScript Booleans

      A boolean value in JavaScript is either yes or no, it is one of the two opposing values. It can also be on/off, true/false, and more. Strings or any number except for zero or equation that are correct is true. Basically, anything that is real retures true, and anything not real will reture false.Here some exercise about Boolean conditions from W3schools:

Exercise 1:

Exercise 2:

Exercise 3:

Exercise 4:

Exercise 5:


Exercise 6:



As you can see, typing "John" will reture a true boolean that writes the string "Hello John!".

And not typing "John" will reture a false boolean that writes "You are not John!".

No comments:

Post a Comment