Wednesday, 22 February 2017

Important JavaScript Interview Questions

 JavaScript Interview Questions 
1. What is JavaScript?
Javascript is client-side as well as server facet scripting language that can be inserted into HTML pages and is understood through internet browsers. javascript is likewise an item orientated programming language

2. Which company developed JavaScript?
Netscape is the software organization who evolved javascript. 

3. What is a prompt box?
a prompt box is a container which lets in the user to go into input by way of supplying a textual content box.  label and container will be supplied to enter the textual content or wide variety.

4. What is ‘this’ keyword in JavaScript?
‘this’ keyword refers to the object from where it became called.

5. What is the difference between ViewState and SessionState?

‘ViewState’ is specific to a page in a session.

‘SessionState’ is specific to user specific data that can be accessed across all pages in the web application.

6. What is = = = operator?
= = = is referred to as-is strict equality operator which returns authentic when the 2 operands are having the identical cost with none kind conversion.

7. Explain how can you submit a form using JavaScript?
to post a form using javascript use file.shape[0].publish();


8. Explain how to read and write a file using JavaScript?
To put up a shape the use of javascript use document.shape[0].post();


there are  approaches to read and write a report the use of javascript

using javascript extensions
using a web page and energetic x gadgets.

9. Name some of the JavaScript features.

Following are the features of JavaScript −

*  javascript is a light-weight, interpreted programming language.
*  javascript is designed for developing community-centric programs
*  javascript is complementary to and integrated with java.
*  javascript is open and go platform.

10. What are the advantages of using JavaScript?

Following are the advantages of using JavaScript −

Much less server interplay − you can validate consumer input earlier than sending the page off to the server. this saves server site visitors, because of this much less load on your server.

Instantaneous remarks to the traffic − they do not ought to watch for a page reload to see in the event that they have forgotten to go into something.

Increased interactivity − you can create interfaces that react whilst the user hovers over them with a mouse or activates them through the keyboard.

Richer interfaces − you can use javascript to include such gadgets as drag-and-drop components and sliders to present a rich interface on your site visitors.

11. Is JavaScript a case-sensitive language?

sure! javascript is a case-sensitive language. which means that language keywords, variables, function names, and any other identifiers should usually be typed with a steady capitalization of letters.

12. How can you create an array in javascript?
you could outline arrays the use of the array literal as follows −

var x = [];
var y = [1, 2, 3, 4, 5];

13. How can you convert the string of any base to an integer in JavaScript?

the parseint() characteristic is used to convert numbers among extraordinary bases. parseint() takes the string to be transformed as its first parameter, and the second one parameter is the base of the given string.

on the way to convert 4f (of base 16) to integer, the code used might be –

parseInt ("4F", 16);

14. What is the function of delete operator?
The functionality of delete operator is used to delete all variables and gadgets in a software however it can not delete variables declared with var key-word.

15. What is The difference between an alert box and a confirmation box ?

an alert box presentations best one button which is the adequate button.

but a confirmation box presentations two buttons particularly ok and cancel.

16. What are the valid scopes of a variable in JavaScript?

the scope of a variable is the region of your program wherein it's far defined. javascript variable can have best  scopes.

Global variables − a global variable has global scope which means it's miles seen everywhere in your javascript code.

local variables − a local variable will be seen only within a characteristic where it's far defined. function parameters are always local to that feature.


Post a Comment