WElcome to Milstone 04, Module 23 Practice section. I am Nizam, Student of Programming Hero Course, Batch 07.

Module-23 Practice




Video 23-1 : Module Introduction and isArray, includes, concat

Video 23-2 Get part of an array and insert elements using slice, splice

Video 23-3 Remove duplicate items from an array

Video 23-4 Write foo, bar, foobar if divisible by 3 or 5 or both

Video 23-5 Use add and multiplication to calculate wood requirements

Video 23-6 Find the cheapest phone from an array of phone objects

Video 23-7 Calculate the total cost of the products in a shopping cart

Video 23-8 (advanced) Multi-layer discount price calculation

Video 23-9 Handle unexpected function input parameter error

Video 23-10 Module Summary and importance of problem solving

QUIZ

Q1: Is JavaScript case sensitive? (google it)
Ans: Yes

Q2: Which one is false?
Ans: You can write only one return inside a function

Q3: which one will decrease the value of num by 1;
Ans: num--

Q4: How to write an IF statement for executing some code if "i" is NOT equal to 5? (be careful)
Ans: if(i!= 5)

Q5: How will you loop through this array? const nayoks=[“Bangla Bhai”,”English Bhai”,”Korean Bhai ”,”Turkish Bhai ”] ?
Ans: for ( const nayok of nayok){}

Q6: How do you find the smaller number of x and y?
Ans: Math.min(x, y)

Q7: What will be the final value of the sum? let sum=0; for( let i = 0; i<=3;i++){ sum = sum + i; }
Ans: 6

Q8: Which one is true?
Ans: You can get the length of a string like myString.length

Q9:How will you delete the age property of the object student (google it)
var student = { name : "Yo Mama", age : 17 };
Ans: delete student.age

Q10: How will you change the last element of an array? (google it)
Ans: arr[arr.length-1] = 5

BONUS VIDEO

Video 24_5-1 : Understand recursion using sum of numbers

Video 24_5-2 Explore Factorial Recursion using a for loop concept

Video 24_5-3 (optional) Explore what you can do with JavaScript Object

Video 24_5-4 (advanced) Find the matching product by searching products

Video 24_5-5 Problem solving priority and get best out of this course

QUIZ

Q1: What is the purpose of the parseInt() method?
Ans: To convert a floating point or a number in string to an integer

Q2: Which of the following is not considered as an error in JavaScript?(This could be tricky , read carefully )
Ans: Division by zero

Q3: The snippet that has to be used to check if “a” is not equal to “null” is _________
Ans: if(a!=null)

Q4: What will be the output of the following JavaScript code?
function compare(a, b) {
if (a == b) {
return true;
} else {
return false;
}
}
const result = compare(15, "15");
console.log(result);
Ans: true

Q5: What will be the output of the following JavaScript code? (Hey , Read Carefully)
function compare(a, b) {
if (a.toString() === b) {
return true;
} else {
return false;
}
}
const result = compare(25, 25);
console.log(result);
Ans: false

Q6: What will be the output of the following JavaScript code? (Hint: Implicit type conversion)
console.log("123" + 123);
Ans: 123123

Q7: What will be the output of the following JavaScript code?
let a=”hi”
let b=”there”
console.log(a+b)
Ans: hithere

Q8: How will you print the numbers from 5 to 100:
for(___?___ ; _____?_____ ; ____?____)
Ans: let i = 5; i<= 100;i++

Q9:The unordered collection of properties, each of which has a name and a value is called _________
Ans: object

THE END