What is "typeof" operator in JavaScript

What is "typeof" operator in JavaScript

ยท

1 min read

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!

ย