JavaScript is the language of Web. Website without JS like body without soul. JS is the first choice of developer not due to its flexibility but also due to web console. Web console make debugging superfast and allow developers to make new change on the go.

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.


In part 1 , we discussed about creation , conversion , comparison and String class and primitive string.

Reversing an string

Using split , reverse and join (popular method)


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).

1) Basic Information

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 boolean
type of null is also object

functions are also object in js but typeof shows strange
behaviour in case of null and function
null 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.

  1. count ⇾ it places a counter on the object value provided as argument. Each time value is appeared in count, counting is increased (“exception is empty string which do not contains label”).
[label] : X 
Output for count

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.

Rahul Beniwal

I am programmer and web developer who loves to teach

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store