How to get the data type of a variable in Node.js

1 Answer

0 votes
console.log(typeof "node.js")
console.log(typeof ("node.js" + "pro"))
console.log(typeof 58.103)
console.log(typeof 9382)
console.log(typeof (34 + 9))
console.log(typeof true)
console.log(typeof false)
console.log(typeof 3045n)
console.log(typeof x)



/*
run:

string
string
number
number
number
boolean
boolean
bigint
undefined

*/

 



answered Nov 8, 2024 by avibootz

Related questions

1 answer 112 views
112 views asked Feb 4, 2022 by avibootz
1 answer 109 views
1 answer 126 views
1 answer 107 views
1 answer 92 views
1 answer 80 views
1 answer 98 views
...