Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (8 sloc) 267 Bytes

You can use typeof to check the data structure, or type, of a variable.

Note that in JavaScript, arrays are technically a type of object.

console.log(typeof(""));

console.log(typeof(0));

console.log(typeof([]));

console.log(typeof({}));
Something went wrong with that request. Please try again.