Skip to content

israqshakil/assignment6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • var variables can be re-declared and updated
  • let can be updated but not re-declared
  • const cannot be updated or re-declared

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

  • map(): => It is a built-in array method that makes a new array by applying a function to each element of an existing array. => It doesn’t change the original array.

  • forEach(): => It is another array method. => It executes a function for each element, but it does not return a new array.

  • filter(): => It is an array method in JS. => It picks only items that match a condition. => It gives back a new array.

3) What are arrow functions in ES6?

  • It is a shorter and cleaner technique to write functions in JavaScript.

4) How does destructuring assignment work in ES6?

  • It is an easier way to unpack values from arrays into variables.

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

  • Template literals are a new way to create strings using backticks instead of quotation mark.

      -> It uses backticks (``).
      -> It can insert variables or expressions directly by using ${}.
      -> It supports multi-line strings.
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors