Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be8c55d commit a278045Copy full SHA for a278045
week2js/3tada15_17.js
@@ -31,17 +31,8 @@ console.log(o3); // yes o3 has been changed//
31
32
// 17. type of//
33
let bar = 42;
34
-console.log(typeof typeof bar);
35
-console.log(typeof bar);
+console.log(typeof typeof bar); //returns 'string' because the word number is a string?//
+console.log(typeof bar); //returns 'number' because the value of bar is 42 which is a number//
36
console.log(bar);
37
38
-// 42 is a primitive (ie because it is a number). so you cannot get a typeof of it usually as it has no property.
39
-//but in order to get a typeof, it is temporarily coerced into being an object.
40
-//so then it can return a value ie string (line 34) or number (line 35)
41
-//the created object is then removed into the garbage.
42
-
43
44
45
46
47
0 commit comments