In this session, I will give you some about cool tips about console and “console”. I will try to keep it short and concise, I will share you more tips when I get.
first open your JS console , using Ctrl + Shift + i or press F12 or using your browser preferences.
Strings are the one of the most used data types not only in JS but also in all programming language. Object are also very popular ( discuss object in other post).
In JS string can be enclosed either in ‘single quote’ or in “double quote” and also in `backticks` (ES2015 , ES16)
1) typeof : typeof is the function use to get the type in js.
boolean only true and false are allowed for booleantype of null is also object
functions are also object in js but typeof shows strange
behaviour in case of null and functionnull also return "function" , i consider it as datatype as it only accepts null as a only value
2) Finding an object’s class
To find whether a object was constructed by by a certain constructor or one inheriting from it , we can use instanceof keyword
console.log(2 instanceof Number)…
This is my second blog on this topic and in this we will talk in some advance topic which are lesser known (I think) by beginners.
[label] : X
2. trace ⇾ it outputs the current stack trace or display the same output as console.log if invoked in the global scope. This method is very useful in tracing the recursion.