Practice Problems (Practical 19)
Practical 19: Create HTML page with <div> and button. Write ES6 function with two
default parameters a and b. Function takes arguments c and d. On button click, calculate: Result = (aĆb)
+ c ā d. Display result inside <div>.
Q1: Differentiate between var, let, and const.
Q2: What are template literals? Give an example.
Q3: Explain arrow functions and how they differ from regular functions.
Q4: What is the difference between forEach() and map()?
Q5: Explain the spread operator (...) with examples.
Q6: How do you use default parameters in functions?
Q7: Create a function that uses rest parameters to sum multiple numbers.
Q8: Explain the difference between filter() and find() array methods.