Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (34 sloc) 1.26 KB
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../../../template/operatorWrapper.xsl"?>
<operator name="typeof">
<p>typeof — Check the type of a variable.</p>
<p>typeof <params/></p>
<parameter name="variable" type="mixed" optional="false">The variable to get the type of.</parameter>
<heading>typeof example</heading>
var b = new Boolean(true); // Create a new boolean object.
console.log(typeof b); // object
console.log(typeof true); // boolean
console.log(typeof 'jsman'); // string
console.log(typeof undefined); // undefined
console.log(typeof null); // object
console.log(typeof 1234); // number
console.log(typeof NaN); // number
console.log(typeof Infinity); // number
<wp href="">typeof operator</wp>
<mdn href="">typeof operator</mdn>
<msdn href="">typeof operator</msdn>