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.js
03var_data_types.js
/** * See all possible variable types in Javascript * number, string, boolean, object, undefined */ //number var a = 5.23; var type = typeof a; console.log(type+': '+a); //string var b = 'some text čćžšđ'; var type = typeof b; console.log(type+': '+b); //boolean: true | false var c = true; var type = typeof c; console.log(type+': '+c); //object (null) var n=null; var type = typeof n; console.log(type+': '+n); //object (array) var arr=[12, 'some text']; var type = typeof arr; console.log(type+': '+arr); //object var obj={color:'red', year:1971}; var type = typeof obj; console.log(type+': '+obj); //undefined function fja() {} var type = typeof fja; console.log(type+': '+fja); //undefined var type = typeof x; console.log(type+': ');
Reload page
Preview
W3C validation
Edit Code
JS Console