JavaScript - Interview Questions and Answers for 'JavaScript' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



JavaScript - Interview Questions and Answers for 'JavaScript' - 35 question(s) found - Order By Rating

next 30
 Q1. What is Array.Map function ? What will be output of following ?

const myArray = [1, 4, 9, 16];
const result = myArray.map(x => x * 2);
Javascript
Ans. It will create an array with each value as x*2

[2, 8, 18, 32]

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 2 Companies


 Q2. Is it safe to use session storage ?Javascript
Ans. Session storage can be accessed from XSS (Cross site Scripting) attacks but cookies (if set with "HttpOnly" and "Secure" flags) are more safer against these attacks.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     session storage  security


 Q3. How can you trim all strings in an array ?
Ans. array.map(s => s.trim())

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   angular   typescript   javascript


 Q4. How can print the whole object state in the console in javascript ?Javascript
Ans. We can JSON.stringify

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     javascript  angular


 Q5. What are the benefits of using UI framework like Angular , View js etc instead of plain vanilla js and html ?Javascript
Ans. These frameworks facilitates easier product development and enhancement and maintainability by having separation of concerns ( using oops ) and helps in development of reusable libraries / components. So in nutshell , they make development and maintenance of large scale application easier.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Javascript Frameworks  Angular  View js


 Q6. Have you ever used sessionStorage ? What is the better way to store session information - sessionStorage or session cookie ?Session Management
Ans. Session Cookie, because session storage can be accessed from XSS (Cross site Scripting) attacks but cookies (if set with "HttpOnly" and "Secure" flags) are more safer against these attacks.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     SessionStorage  session cookie  session management  javascript


 Q7. what is strict mode in javascript ? How is it used ?Javascript
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q8. How is cohesion achieved in JavaScript ?JavaScript
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q9. How Object-Oriented Programming is implemented in JavaScript? How they differ from other languages?Javascript
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     object oriented programming in javascript  oops in javascript


 Q10. How is the declaration of enum in Typescript differ from Javascript ?TypeScript
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     enum typescript  enum javascript


 Q11. What are benefits of strongly typing variables ?JavaScript
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     strong typing javascript


 Q12. Difference between Let and Var in Javascript ?JavaScript
Ans. Var scopes the variable to the nearest function whereas Let scopes the variable to nearest block.

For example -

function printNumbers() {
for(var i = 1; i < 3: i++){
console.log(i);
}

console.log(i); // works fine and will print 3 as i has a function scope and not local loop scope
}

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     let vs var in javascript  let vs var   difference between let and var


 Q13. prototypal inheritance in JavascriptJavaScript
 This question was recently asked at 'RocketMiles'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q14. Have you had to work with memory leak problems in javascript ?JavaScript
 This question was recently asked at 'RockYou'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q15. Write a method to track every click on a page.JavaScript
 This question was recently asked at 'LinkedIn'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q16. What is the difference between inheritance in PHP vs. Javascript?JavaScript
 This question was recently asked at 'WePay'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     php  javascript     Asked in 1 Companies


 Q17. What is Defer Parsing JavaScript ?JavaScript
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q18. How do you debug Javascript code ?Javascript
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q19. What does 'variable hoisting' mean? JavaScript
Ans.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q20. What is the use of this keyword in javascript ?Javascript
Ans. This keyword refers to the current instance of the class.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q21. What is type script ? What are the advantages of typescript ? How is it different than javascript ?TypeScript
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Typescript vs Javascript


  Q22. Difference between == and === ?JavaScript
Ans. == compares values === is used in scripting languages for comparing two values as well as there data tpe. like in js,php.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     ==  ===  == vs ===     Asked in 13 Companies      basic        frequent


 Q23. How do you debug Javascript code ?JavaScript
Ans. Possible Answer - I use either Firebug or Chrome Developer tool.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q24. What is the difference between Java OR operator and Java script OR operator ?JavaScript
 This question was recently asked at 'Symantec'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q25. Which statement is used to exit a function in java script ?JavaScript
Ans. return

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q26. How can java script access a database ?JavaScript
 This question was recently asked at 'American Express'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q27. what is event handler script ?JavaScript
 This question was recently asked at 'American Express'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q28. How would you choose your favorite company name for e.g. three companies are given in radio buttons Infosys, TCS and Aricent. Do You need to loop trough all radio buttons and select your favorite company or can just get the selected value.Javascript
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q29. Difference between Scriptlet and JSTL.Javascript
 This question was recently asked at 'Hexaware'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q30. What are falsy attributes in javascript ?Javascript
Ans. A falsy value is something which evaluates to FALSE, for instance when checking a variable. There are only six falsey values in JavaScript: undefined, null, NaN, 0, "" (empty string), and false of course.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


next 30

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: