Snippet

Types de données JavaScript

6 réponses de la communauté

// What are JavaScript Data Types?
let name = "Chetan";                           // string
let age = 30;                                  // number 
let fullName = {first:"Chetan", last:"Nada"};  // object
let truth = false;                             // boolean
let language = ["HTML","CSS","JS"];            // array
let x; typeof x;                               // undefined
let val = null;                                // value null
true, false						// 1. Boolean
null 							// 2. Null
undefined 						// 3. Undefined
1, 4, 7, 231, 51, 11, 9			// 4. Number
9007199254740991n				// 5. BigInt
'Hello', 'World', 'Uzbekistan'	// 6. String
let sym1 = Symbol()				// 7. Symbol
{a: 123}, [1]					// 8. Objects
Number  // var age = 18
String	// var name = "codepadding"
Boolean	// var prgramming = true
Object	// var fullName = {first:"Code", last:"Padding"};
Undefined // var program; typeof program
array	// var language = ["javaScaript","dart"]
null	// var error = null
var age = 18;                           // number 
var name = "Jane";                      // string
var name = {first:"Jane", last:"Doe"};  // object
var truth = false;                      // boolean
var sheets = ["HTML","CSS","JS"];       // array
var a; typeof a;                        // undefined
var a = null;                           // value null
typeof(string)
let x = "16" + "Volvo";