November 8, 2018

Sreekanth B

Symantec Most Frequently Asked Latest JavaScript Interview Questions Answers

What are the new ways to define a variable in Javascript?

There are three possible ways of defining a variable in Javascript (i) var (which is used from the beginning) (ii) const (iii) let. The last two ways are the latest ways of defining a variable and are introduced in ES-2015(ES6 version).

What is a function callback?

The callback function is a mechanism to send one function to another function as an argument; i.e., passing func as an argument to another function.

What happens when the recursion calling is applied on two functions?

The calling of recursion is possible in two functions, but the call comes to an end after some time.

What will this code print?

It will print 0 1 2 3 4, because we use let instead of var here. The variable i is only seen in the for loop’s block scope.

What do the following lines output, and why?

console.log(1 < 2 < 3);
console.log(3 > 2 > 1);

The first statement returns true which is as expected.

The second returns false because of how the engine works regarding operator associativity for < and >. It compares left to right, so 3 > 2 > 1 JavaScript translates to true > 1. true has value 1, so it then compares 1 > 1, which is false.

Explain the term closure.

The inner functions can be called as closure when it has access to the outer function's variables.
Symantec Most Frequently Asked Latest JavaScript Interview Questions Answers
Symantec Most Frequently Asked Latest JavaScript Interview Questions Answers

Explain the terms synchronous and asynchronous code.

The synchronous code is something that should be finished before anything else can happen, or in other words, the synchronous code is blocking. And the Asynchronous code is something in which actions can happen and is not dependent on other actions- in other words, it is non-blocking.

Name the different types of pop up boxes in Javascript.

There are three types of pop up boxes in Javascript (i) alert() provides some information to the user with just an OK button (ii) confirm() asks a question to the user with two options Ok and cancel, and (iii) prompt() takes an input from the user.

What is Ajax?

Ajax is abbreviated as Asynchronous Javascript and XML. It is new technique used to create better, faster and more interactive web systems or applications. Ajax uses asynchronous data transfer between the Browser and the web server.

This technique is used to make internet faster and user friendly. It is not a programming language.

What are the disadvantages of Ajax?

Following are the disadvantages of Ajax:

AJAX is dependent on Javascript. If there is some Javascript problem with the browser or in the OS, Ajax will not support
Ajax can be problematic in Search engines as it uses Javascript for most of its parts.
Source code written in AJAX is easily human readable. There will be some security issues in Ajax.
 Debugging is difficult
 Increases size of the requests
 Slow and unreliable network connection.
Problem with browser back button when using AJAX enabled pages.

What is update panel?

Update panel  is a server control used to update the specified portion of a web page. Script Manager needs to be used whenever update panel is used. Using update panel, user cannot handle outside controls.

Which are the two methods used for cross domain Ajax calls?

There are two methods used to transfer data between the two more more security domains:

CORS – Cross Origin Resource Sharing and it works with the HTTP web browsers
JSONP – JSON with Padding which works with the HTTP GET and on legacy browsers

What are all the technologies used by Ajax?

AJAX uses following technologies:

JavaScript
XMLHttpRequest
Document Object Model (DOM)
Extensible HTML (XHTML)
Cascading Style Sheets (CSS)

What are all the features of Ajax?

Following are the features of Ajax and they are as follows:

Live data binding
Client-side template rendering
Declarative instantiation of client components
Observer pattern on JavaScript objects and arrays
Invoking ADO.NET data services and data contexts
DataView control

What are Ajax applications?

Browser based applications and platform independent applications are used by Ajax.

How many types of triggers are present in update panel?

There are two types of triggers used in update panel:

PostBackTrigger – This works as full postback and it cannot work asynchronously
AsyncPostBackTrigger – Partial post back asynchronously

What are all the controls of Ajax?

Following are the controls of Ajax:

ScriptManager
ScriptManagerProxy
UpdatePanel
UpdateProgress
Timer

What is the name of the DLL that contains Ajax control tool kit?

Ajaxcontroltoolkit.dll is the DLL used for Ajax control tool kit and it can be downloaded from the internet. It can be added in the tool box or copied directly in the bin folder.

What role of #&& in querystring?

# is treated as fragment delimiter to delimit the history state and && precedes is used to check on the information in the query string.

What is the use of the ‘this’ keyword?

The keyword ‘this’ refers to the current instance of the object when used inside a function. But, when used outside a function, it refers to the window object.

Subscribe to get more Posts :