Assalamualaikum!

I am Nizam

Student of Batch 07

Module 36 Practice


Video 36-1 Module introduction Different way to Create Object

Video 36-2 Object method access and set property values

Video 36-3 Keys, values, entries, delete, seal, freeze

Video 36-4 Loop through an object using for in, for of, object entries

Video 36-5 (advanced) Compare objects, referential integrity

Video 36-6 (optional) Borrow method from object and use it on another object

Video 36-7 (super advanced) Understand this keyword in JavaScript

Video 36-8 Module summary and checklist

Way to create object: 1. Object literal syntax, 2. Object constructor, 3. Constructor Function, 4. Es6 classes & 5. Object.create()

QUIZ

Q1: Which one is not a way to create an object?
Ans: Using JSON.stringify()

Q2: Call methods accepts _____
Ans: this value and and parameters separated by comma

Q3:What are the purposes of Object.seal()? (google it and read carefully)
Ans: Preventing new properties from being added.

Q4:const nayok = {name: ‘hero’, age:’28’, isMarried: false};
How will you obtain the key-value pair from the nayok object?
Ans: Object.entries(nayok)

Q5:Why do we use the bind method?
Ans: To borrow method from another object

Q6:How will you loop through all the properties of an object?
Ans: Using for..in loop

Q7:const obj ={a:1, b:7, c:3, length:2}; console.log(Object.keys(obj).length); What will be the output?(Try it out.)
Ans: 4

Q8:const obj1= {module: 35, video:2}; const obj2= {module: 35, video:2}; console.log(obj1 === obj2);
Ans: false

Q9:What would be the output of?: const getGirlFriend= (name = "chokina")=>"name"; console.log(getGirlFriend());
Ans: name

Q10: What is a window in JavaScript? Google and read carefully.
Ans: A global variable, window, representing the window in which the script is running