Permalink
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">
<lead>
<p>typeof — Check the type of a variable.</p>
</lead>
<description>
<p>typeof <params/></p>
</description>
<parameters>
<parameter name="variable" type="mixed" optional="false">The variable to get the type of.</parameter>
</parameters>
<examples>
<example>
<heading>typeof example</heading>
<code>
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
</code>
</example>
</examples>
<external>
<wp href="http://docs.webplatform.org/wiki/javascript/operators/typeof">typeof operator</wp>
<mdn href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof">typeof operator</mdn>
<msdn href="https://msdn.microsoft.com/library/259s7zc1(v=vs.94).aspx">typeof operator</msdn>
</external>
</operator>