object type in javascript code example

Example 1: js typeof number

console.log(typeof 93);
// Output = "number"

console.log(typeof 'Maximum');
// Output = 'string'

console.log(typeof false);
// Output = "boolean"

console.log(typeof anUndeclaredVariable);
// Output = "undefined"

Example 2: creating an object javascript

let obj = {
// fields
  name:"value",
  num: 123,
//methods
  foo: function(){}
  
}

Example 3: create object javascript

const object = {
  something: "something";
}

Example 4: check data type in js

var x = "Hello World";
typeof x; // "string"

Example 5: javascript object

let names = {
	name1: 'What ever you want to put'
}

Example 6: objects in javascript

let name = {
	name1: 'mark'
}