What are the data types of JavaScript

1 Answer

0 votes
const n = 6104; // Number
console.log(typeof n)

const s = "javascript"; // string
console.log(typeof s)

const o = {first:"abc", second:"xyz"}; // object
console.log(typeof o)

const b = false; // boolean
console.log(typeof b)

const arr = ["HTML", "CSS", "JS"]; // object
console.log(typeof arr)

// typeof x; // undefined 
console.log(typeof x)

const nl = null; // object
console.log(typeof nl)

const bi = 900719925124740n; // bigint
console.log(typeof bi) 


 
/*
run:
 
number
string
object
boolean
object
undefined
object
bigint
 
*/

 



answered Nov 21, 2024 by avibootz
edited Nov 21, 2024 by avibootz

Related questions

1 answer 196 views
1 answer 151 views
1 answer 228 views
228 views asked Sep 27, 2015 by avibootz
1 answer 214 views
1 answer 141 views
...