SS-TECH LAB SEC-22 ,Noida, .

New Interview Question and Answer

Latest Interview Q/A
Currently Placed Student
Best Python Training Institute In Noida SS-TECH
Ajay Kumar
[ PHP Developer ]

Latest JavaScript Interview Question and Answer
Q #1 ) What is JavaScript?

JavaScript is a scripting language. It is different from Java language. It is object-based, lightweight, cross-platform translated language. It is widely used for client-side validation. The JavaScript Translator (embedded in the browser) is responsible for translating the JavaScript code for the web browser.

Q #2 ) List some features of JavaScript.

Some of the features of JavaScript are:

Volume 0%
  • Lightweight
  • Interpreted programming language
  • Good for the applications which are network-centric
  • Complementary to Java
  • Complementary to HTML
  • Open source
  • Cross-platform

Q #3 ) List some of the disadvantages of JavaScript.

Some of the disadvantages of JavaScript are:

  • No support for multithreading
  • No support for multiprocessing
  • Reading and writing of files is not allowed
  • No support for networking applications.

Q #4 ) Define a named function in JavaScript.

The function which has named at the time of definition is called a named function. For example

function msg()  
  document.write("Named Function");  

Q #5 ) What is the difference between JavaScript and JScript?

Netscape provided the JavaScript language. Microsoft changed the name and called it JScript to avoid the trademark issue. In other words, you can say JScript is the same as JavaScript, but Microsoft provides it.

Q #6 ) How to write a hello world example of JavaScript?

A simple example of JavaScript hello world is given below. You need to place it inside the body tag of HTML.

<script type="text/javascript">  
document.write("JavaScript Hello World!");  

Q #7 ) How to use external JavaScript file?

I am assuming that js file name is message.js, place the following script tag inside the head tag.

<script type="text/javascript" src="message.js"></script>

Q #8 ) Which symbol is used for comments in Javascript?

// for Single line comments and

/* Multi




Q #9 ) Explain the working of timers in JavaScript? Also elucidate the drawbacks of using the timer, if any?

Timers are used to execute a piece of code at a set time or also to repeat the code in a given interval of time. This is done by using the functions setTimeout, setInterval and clearInterval.

The setTimeout(function, delay) function is used to start a timer that calls a particular function after the mentioned delay. The setInterval(function, delay) function is used to repeatedly execute the given function in the mentioned delay and only halts when cancelled. The clearInterval(id) function instructs the timer to stop.

Timers are operated within a single thread, and thus events might queue up, waiting to be executed.

Q #10 ) Explain the difference between "==" and "==="?

"==" checks only for equality in value whereas "===" is a stricter equality test and returns false if either the value or the type of the two variables are different.

Q #11 ) What are all the types of Pop up boxes available in JavaScript?

  • Alert
  • Confirm and
  • Prompt

Q #12 ) What is the difference between an alert box and a confirmation box?

An alert box displays only one button which is the OK button.

But a Confirmation box displays two buttons namely OK and cancel.

Q #13 ) What are the different types of errors in JavaScript?

There are three types of errors:

  • Load time errors: Errors which come up when loading a web page like improper syntax errors are known as Load time errors and it generates the errors dynamically.
  • Run time errors: Errors that come due to misuse of the command inside the HTML language.
  • Logical Errors: These are the errors that occur due to the bad logic performed on a function which is having different operation.