Skip to main content

Command Palette

Search for a command to run...

What is "typeof" operator in JavaScript

Published
•1 min read
What is "typeof" operator in JavaScript
D

I am 17 years old and a young passionate and self-taught frontend web developer and have an intention to become a successful developer. I usually write about JavaScript and Web Development and share some tips in the articles.

typeof operator determines the type of the input

For example,

console.log(typeof 9.8)

The output will be - "number"

console.log(typeof "Gravitational acceleration of Earth is 9.8ms^-2")

The output will be - "string"

console.log(typeof true)

The output will be - boolean


Thank you for reading, have a nice day!

More from this blog

D

Dhairya Shah

119 posts

What is "typeof" operator in JavaScript