JS interview Question/ Answers Set – 3

JS interview Question/ Answers Set – 3

‘use strict’ is used to enable strict mode to automate stricter parsing and error handling when JavaScript code is run. This allows us to run a restricted variant of JavaScript. It enables us to assess the JavaScript code and throw more errors fix issues that may arise for future JavaScript releases. The advantages of ‘use strict’ are:
  • Eliminates some unreasonable features of JavaScript syntax
  • Eliminates some insecurities in the operation of the code
  • Ensures the security of the code running
  • Improves compiler efficiency
The following are some of the methods used to provide effects in jQuery:
  • queue() – shows the queued functions on the selected elements
  • show() – displays the selected elements
  • hide() – hides the matched or selected elements
  • delay() – sets a delay for all queued functions on the selected elements
  • animate() – runs a custom animation on the selected elements
  • fadeIn() – fades in the selected elements
  • toggle() – toggles between the hide() and shows() methods
  • stop() – stops the currently running animation for the selected elements
It is usually not a good practice to use global variables in programming languages including JavaScript. However, you may have to use global variables sometimes. So, JavaScript introduces the concept of namespacing which ties down a part of the code and registers it with a unique name. The namespace is nothing more than a container name where we hold classes, functions, and variables that can be repeated with the same name in other namespaces or namespace without involving an error.
ES5 is an abbreviation of ECMAScript 5 while ES6 is an abbreviation of ECMAScript 6. ECMA is a trademarked scripting language specification defined by ECMA International. The difference between ES5 and ES6 are:

Post Your Comments & Reviews

Your email address will not be published. Required fields are marked *

*

*