Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,872 questions

51,796 answers

573 users

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 175 views
1 answer 127 views
1 answer 207 views
207 views asked Sep 27, 2015 by avibootz
1 answer 181 views
1 answer 114 views
...