You can use typeof to check the data structure, or type, of a variable.
typeof
data structure
Note that in JavaScript, arrays are technically a type of object.
console.log(typeof("")); console.log(typeof(0)); console.log(typeof([])); console.log(typeof({}));
There was an error while loading. Please reload this page.
New to Free Code Camp?
JS Concepts
JS Language Reference
Other Links