Toggle navigation
Genres
Frontend (2)
JavaScript (6)
Database (2)
Linux Server (3)
Web Apps (4)
Misc (4)
Search
List
New Tutorials
Last Modified Tutorials
</>
Code examples
code
smiko
javascript
advanced
variables
03var_data_types_novar.js
03var_data_types_novar.js
/** * See all possible variable types in Javascript * number, string, boolean, object, undefined * Definition without var * The results are completly same as in the previous example. */ //number x = 5.23; var type = typeof x; console.log(type+': '+x); //string x = 'some text čćžšđ'; var type = typeof x; console.log(type+': '+x); //boolean: true | false x = true; var type = typeof x; console.log(type+': '+x); //null x=null; var type = typeof x; console.log(type+': '+x); //undefined type = typeof y; console.log(type+': '); //object (array) z=[12, 'some text']; var type = typeof z; console.log(type+': '+z); //object z={color:'red', year:1971}; var type = typeof z; console.log(type+': '+z);
Reload page
Preview
W3C validation
Edit Code
JS Console