Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
21 Essential JavaScript
Interview Questions
by Codementor Nishant Kumar
What is the difference between undefined
and not defined in JavaScript?
Question 1:
What will be the output of the code below?
var y = 1;
if (function f(){}) {
y += typeof f;
}
console.log(y);
Question 2:
What is the drawback of creating
true private methods in JavaScript?
Question 3:
What is a “closure” in JavaScript?
Provide an example.
Question 4:
Write a mul function which will produce the following
outputs when invoked:

javascript console.log(mul(2)(3)(4)); // outp...
How do you empty an array in JavaScript?
Question 6:
How do you check if an object is an array or not?
Question 7:
What will be the output of the following code?
var output = (function(x){
delete x;
return x;
})(0);
console.log(output);
...
What will be the output of the following code?
var x = 1;
var output = (function(){
delete x;
return x;
})();
console.log(...
What will be the output of the following code?
var x = { foo : 1};
var output = (function(){
delete x.foo;
return x.foo;
}...
What will be the output of the following code?
var x = { foo : 1};
var Employee = {
company: 'xyz'
}
var emp1 = Object.cre...
What is undefined x 1 in JavaScript?
Question 12:
What will be the output of the following code?
Question 13:
var trees = ["xyz","xxxx","test","ryan","apple"];
delete trees...
What will be the output of the following code?
var bar = true;
console.log(bar + 0);
console.log(bar + "xyz");
console.log...
What will be the output of the following code?
var x = { foo : 1};
var z = 1, y = z = typeof y;
console.log(y);
Question 1...
What will be the output of the following code?
// NFE (Named Function Expression
var foo = function bar(){ return 12; };
t...
What is the difference between the following two
functions?
Question 17:
var foo = function(){
// Some code
};
function ba...
What is function hoisting in JavaScript?
Question 18:
What will be the output of the following code?
Question 19:
var salary = "1000$";
(function () {
console.log("Original sal...
What is the instanceof operator in JavaScript?
What would be the output of the code below?
Question 20:
function foo(){
re...
If we have a JavaScript associative array
Question 21:
var counterArray = {
A : 3,
B : 4
};
counterArray["C"] = 1;
How can...
Did you know how to answer all 21 questions?
Feel free to check your answers
& view detailed explanations here!
Prochain SlideShare
Chargement dans…5
×

21 Essential JavaScript Interview Questions

505 461 vues

Publié le

How well do you know JavaScript? Here are 21 JavaScript interview questions you must know. Answers & Explanations are at http://bit.ly/1V9Tn7X

Publié dans : Logiciels, Carrière
  • Nice !! Download 100 % Free Ebooks, PPts, Study Notes, Novels, etc @ https://www.ThesisScientist.com
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • Hello! Get Your Professional Job-Winning Resume Here - Check our website! https://vk.cc/818RFv
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • Hello! Get Your Professional Job-Winning Resume Here - Check our website! https://vk.cc/818RFv
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • Nice !! Download 100 % Free Ebooks, PPts, Study Notes, Novels, etc @ www.ThesisScientist.com
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • Very useful, thanks! Most companies also use coding tests to screen applicants. There's a good JavaScript test here: http://www.testdome.com/Programming-Tests/JavaScript/14
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici

21 Essential JavaScript Interview Questions

  1. 1. 21 Essential JavaScript Interview Questions by Codementor Nishant Kumar
  2. 2. What is the difference between undefined and not defined in JavaScript? Question 1:
  3. 3. What will be the output of the code below? var y = 1; if (function f(){}) { y += typeof f; } console.log(y); Question 2:
  4. 4. What is the drawback of creating true private methods in JavaScript? Question 3:
  5. 5. What is a “closure” in JavaScript? Provide an example. Question 4:
  6. 6. Write a mul function which will produce the following outputs when invoked:
 javascript console.log(mul(2)(3)(4)); // output : 24 console.log(mul(4)(3)(4)); // output : 48 Question 5:
  7. 7. How do you empty an array in JavaScript? Question 6:
  8. 8. How do you check if an object is an array or not? Question 7:
  9. 9. What will be the output of the following code? var output = (function(x){ delete x; return x; })(0); console.log(output); Question 8:
  10. 10. What will be the output of the following code? var x = 1; var output = (function(){ delete x; return x; })(); console.log(output); Question 9:
  11. 11. What will be the output of the following code? var x = { foo : 1}; var output = (function(){ delete x.foo; return x.foo; })(); console.log(output); Question 10:
  12. 12. What will be the output of the following code? var x = { foo : 1}; var Employee = { company: 'xyz' } var emp1 = Object.create(Employee); delete emp1.company console.log(emp1.company); Question 11:
  13. 13. What is undefined x 1 in JavaScript? Question 12:
  14. 14. What will be the output of the following code? Question 13: var trees = ["xyz","xxxx","test","ryan","apple"]; delete trees[3]; console.log(trees.length);
  15. 15. What will be the output of the following code? var bar = true; console.log(bar + 0); console.log(bar + "xyz"); console.log(bar + true); console.log(bar + false); Question 14:
  16. 16. What will be the output of the following code? var x = { foo : 1}; var z = 1, y = z = typeof y; console.log(y); Question 15:
  17. 17. What will be the output of the following code? // NFE (Named Function Expression var foo = function bar(){ return 12; }; typeof bar(); Question 16:
  18. 18. What is the difference between the following two functions? Question 17: var foo = function(){ // Some code }; function bar(){ // Some code };
  19. 19. What is function hoisting in JavaScript? Question 18:
  20. 20. What will be the output of the following code? Question 19: var salary = "1000$"; (function () { console.log("Original salary was " + salary); var salary = "5000$"; console.log("My New Salary " + salary); })();
  21. 21. What is the instanceof operator in JavaScript? What would be the output of the code below? Question 20: function foo(){ return foo; } new foo() instanceof foo;
  22. 22. If we have a JavaScript associative array Question 21: var counterArray = { A : 3, B : 4 }; counterArray["C"] = 1; How can we calculate length of its counterArray?
  23. 23. Did you know how to answer all 21 questions? Feel free to check your answers & view detailed explanations here!

×