Important JavaScript Questions and Answers
In this Article we are trying to provide most important JavaScript Questions and Answers mcqs, (set 3) which mostly used for interviews and to developing the software. For further we will upload article as well as soon.
JavaScript is most powerful and Latest technology support to Linux, Unix,windows etc. we hope this article would be very helpful . So after reading the article Visit our Facebook Page and give feedback in comments. because it important for us. at the end of page by clicking next button read more articles.
Q.1…How to convert Javascript Date to ISO Standard.??
There is method to convert JavaScript date to ISO standard . method is toISOString().
Now we see it in practical code..
var date = new Date();
var b = date.toISOString();
console.log(b);
// YYYY-MM-DDTHH:mm:ss.sssZ
Q.2 How to clone an object in Javascript.???
Object.assign() method is used for cloning an object in Javascript we see it below .
Here is sample usage
var x = {myProp: “value”};
var y = Object.assign({}, x);
Q.3 Write some unit testing frameworks JavaScript..???
There are many unit testing frameworks here we list some..
- Unit.js
- Jasmine
- Mocha
- JSUnit
- QUnit
- Q.4 Is JavaScript is multithread or single threaded ..??
Simple and complete answers is ..
JavaScript is single threaded
Q.5..What is the use of let and const in javascript..???
Earlier in javaScript only var keyword use to creating a variable.. but in ES6 introduced let and const keyword to creating a variable .
Const: const is used to create immutable variable , it means the value of const variable never changed in complete life cycle of program.
Let: variable which create by ley keyword called mutable variable . these are like as var that can be changed.