1 2 3 4
Assalamualaikum! Welcome to Milstone 06, Module 32 Practice section, I am Nizam, Student of Batch 07.

Module 32 Practice

Video 32-0 Basic ES6 Concept

Video 32-1 Module Introduction and Basic ES6 Recap

Video 32-2 Access Value, nested object Optional chaining

Video 32-3 Array map to do one line loop magic

Video 32-4 Map string array, array of objects map, foreach

Video 32-5 Implement filter, find on an array of objects

Video 32-6 (optional) Explore Reduce and Dot notation

Video 32-7 (semi-advanced) Class, constructor, method, create object from class

Video 32-8 (advanced) Inheritance, extends class, super, class method

Video 32-9 Module summary and Practice Problem

QUIZ

Q1: What is the final value of "obj" in the following example?
const obj = { foo: 1 };
obj.bar = 2;
Ans: {foo: 1,bar:2}

Q2: What will be the output ? function min(nums){ return Math.min(nums) } console.log(min( [1,3,2 ]))
Ans: NaN

Q3: What will be the output? const cube=x=> x*x*x; console.log(cube(2))
Ans: 8

Q4: What would be the output ? const [a, b] = [1,2,3,4,45,5]; console.log(a+b);
Ans: 3

Q5: What will the filter method return?
Ans: An array containing all the matching elements

Q6: What will be the value of y?
const {x, y, z} = {x: 1, y1: 2, z: 3};
Ans: undefined

Q7: What will be the output?(Try it out. It’s tricky.)
const nums = [1,2,3,4,5];
let output = nums.filter(n => n%2);
console.log(output);
Ans: [1,3,5]

Q8: How will you find the first friend who has a name with 5 characters?
const friends = ["Moushumi", "Misha", "Manna", "mimi" , "mahiya"];;
Ans: friend.find(friend => friend.length == 5);

Q9: How will you get the price from the product object?
const product = {name: 'Laptop', model:'Yoga 3', price:49000, dusk: '512SSD'}
You have selected "const {price} = product.price;" but correct answer is "const {price} = product;".
Ans: const{price} = products;

Q10:How will you create an instance of Person Class ?
Ans: const student = new Person()