We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent be8e146 commit 4df62ecCopy full SHA for 4df62ec
page/javascript-101/testing-type.md
@@ -21,13 +21,18 @@ var myObject = {
21
var myArray = [ "a", "b", "c" ];
22
var myString = "hello";
23
var myNumber = 3;
24
+var myRegExp = /(\w+)\s(\w+)/;
25
26
typeof myFunction; // "function"
27
typeof myObject; // "object"
28
typeof myArray; // "object" -- Careful!
29
typeof myString; // "string"
30
typeof myNumber; // "number"
31
typeof null; // "object" -- Careful!
32
+typeof undefined; // "undefined"
33
+typeof meh; // "undefined" -- undefined variable.
34
+typeof myRegExp; // "function" or "object" depending on environment.
35
+
36
37
if ( myArray.push && myArray.slice && myArray.join ) {
38
// probably an array (this is called "duck typing")
0 commit comments