Javascript Coding Example : Object Quiz

These are some quiz for you

  1. Create variable named Identity by having object with this requirements:-

#Having property named “name”
* — use string data type with any values (don’t use undefined/null value)
#Having property named “born”
* — use string data type with any values (don’t use undefined/null value)
#Having property named “My age”
* — use number data type with values (don’t use undefined/null value) #Having property named “Live”
* — use boolean data type with true/false value.

2. Create variable named Name by having “name” value from Identity object properties.

3. Create variable named Born by having “born” value from Identity object properties.

// The Answer
var Identity= {
name: “Hai”,
born: “Hawaii”,
“My Age”: 17,
Live: true,
};

var Name= (Identity.name);
var Born= (Identity.born);

console.log(Name);
console.log(Born);

//OUTPUT CODING

Hai
Hawaii

--

--