English Quiz - async/await, scope

이소라·2023년 5월 9일
0

Interview Questions

목록 보기
26/67

1. Explain the difference between Async/Await and Promises.

  1. Syntax: Promises use a chaining syntax with '.then' and '.catch' to handle asynchronous operations. On the other hand, 'async/await' provides a more concise and synchronous-looking syntax for writing asynchronous code. it improves code readability and maintainability.
  2. Error handling: With promises, you handle errors using '.catch' at the end of the chain, while 'async/await' allows you to handle errors using standard 'try/catch' blocks.

2. What is scope in JavaScript?

  • Scope refers to accessibility and visibility of variables, functions, and objects in JavaScript. It determines where variables and functions are defined and where they can be referenced.

3. Explain the difference between ‘visibility: hidden’ and ‘display:none’.

  • 'visibility: hidden' hides an element while still occupying space in the layout and maintaining its presence in the DOM, whereas 'display: none' hides an element, removes it from the layout, and removes it from the DOM.



4. What is closure in JavaScript?

  • A closure is a function that remembers its outer variables and can access them. In JavaScript, all functions are naturally closures. They automatically remember where they were created using a hidden [[Environment]].

참고

2개의 댓글

comment-user-thumbnail
2024년 3월 20일

Most of the turns and essays are implied for the individuals. The rule of the https://studentwritingservices.com/research-papers/ by all issues. Themes ensured for the teams’ for the twisting items for the masters for the theme for all students.

답글 달기
comment-user-thumbnail
2024년 3월 30일

Various fabrics are timeless wardrobe staples such as robes and caftans that have been worn by suzani embroidery women around the world for centuries. Their enduring popularity speaks to their comfort, versatility, and effortless style.

답글 달기