Skip to content

fahid2002/IssueTracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1️⃣ What is the difference between var, let, and const? ans- These are used to declare variables in JavaScript. var is the older method and it has function scope, which sometimes causes confusion in larger programs. let was introduced later and it works inside a block, so it is safer to use. const is also block scoped, but the value cannot be reassigned once it is declared.

2️⃣ What is the spread operator (...)? ans- The spread operator (...) is used to expand elements of an array or object. It makes it easier to copy or combine data without changing the original one. For example, we can merge two arrays using the spread operator.

3️⃣ What is the difference between map(), filter(), and forEach()? ans- These three methods are commonly used with arrays. map()- It goes through each element and returns a new array with modified values. filter()-It also creates a new array but only keeps the elements that match a condition. forEach()- Simply loops through the array and performs an action, but it does not return a new array.

4️⃣ What is an arrow function? ans- An arrow function is a shorter and cleaner way to write a function in JavaScript. It uses the => symbol and helps make the code easier to read, especially for small functions.

5️⃣ What are template literals? ans- Template literals are a way to write strings using backticks (`). They allow us to insert variables directly inside a string using ${} which makes string formatting easier.

Releases

No releases published

Packages

 
 
 

Contributors