JavaScript - Interview Questions and Answers for 'JavaScript' - 35 question(s) found - Order By Newest Ans. A cookie is a small piece of text stored on a user's computer by the browser for a specific domain. Commonly used for authentication, storing site preferences, and server session identification. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  cookie   javascript   web application   session management   browser   j2ee Asked in 16 Companies basic   frequent Q2. Which of the following is fastest to locate the DOM element ? a. document.getElementById b. document.getElementByName c. document.ElementName.SubElementName d. They all result in similar performance in retrieving the DOM element.
Ans. document.ElementName.SubElementName Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  html   dom   javascript Q3. Why should we have Javascript method definitions within HTML Head section ? a. Its safe to have javascript code within head section b. Head section gets loaded even if there is any error in loading HTML page c. Head section gets executed first and hence assure that js method definition will be loaded before they are called d. So that we can have method definition and method call at the same place
Ans. Head section gets executed first and hence assure that js method definition will be loaded before they are called Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  html   head section   javascriptAns. LinkedIn Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  event bubbling  events Asked in 1 Companies Q5. What is event handling ? What is event propagation ? JavaScript
Ans. LinkedIn Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  event habdling  event propagation  events Asked in 1 Companies Q6. 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   Q7. 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 Q8. 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   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 Q10. 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 Q11. 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 Q12. 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 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 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 Q15. 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 Q16. 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 Q17. 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 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   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   Q20. 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 Q21. 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 Q22. 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 Q23. prototypal inheritance in Javascript JavaScript
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 Q24. 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 Q25. 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 Q26. 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 Q27. 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 Q28. 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   Q29. 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   Q30. 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