Add the text "x = true; console.log(type of x) // boolean ``` From t… (#26111)

* Add the text "x = true; console.log(type of x) // boolean ```  From the last example above, The `typeof` operator returns a boolean that represents the current type of a variable; x which is of value `true`."

* Revert extra sentence
This commit is contained in:
Olayemi Adebayo Roheem
2018-12-21 11:09:38 +01:00
committed by Manish Giri
parent 4606509d9c
commit e1e1f1cabb

View File

@ -25,6 +25,8 @@ x = 'string';
console.log(typeof x) // string
x = { key: 'value' };
console.log(typeof x) // object
x = true;
console.log(type of x) // boolean
```
This can be useful for checking the type of a variable in a function and continuing as appropriate.