Skip to content

SadmanWebDev/Assignment-Six

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1) What is the difference between var, let, and const?

Ans: var is function-scoped and allows redeclaration, let is block-scoped and allows reassignment, const is block-scoped and cannot be reassigned.

2) What is the difference between map(), forEach(), and filter()?

Ans: forEach() executes a function on each element (no return), map() creates a new array with modified values and filter() returns elements that meet a condition.

3) What are arrow functions in ES6?

Ans: Arrow functions are a shorter syntax for writing functions (()=>{}) introduced in ES6.

4) How does destructuring assignment work in ES6?

Ans: Destructuring allows extracting values from arrays or objects into variables easily.

5) Explain template literals in ES6. How are they different from string concatenation?

Ans: Template literals use backticks (`) to allow string interpolation and multi-line strings. They different from string concatenation because template literals are more powerful, cleaner, and support multi-line + interpolation, while concatenation is more verbose and harder to maintain.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published