October 11, 2018

Sreekanth B

VMWare JavaScript Most Frequently Asked Latest Interview Questions Answers

What is a Typed Language?

Typed Language is in which the values are associated with values and not with variables. It is of two types:

Dynamically: in this, the variable can hold multiple types; like in JS a variable can take number, chars.

Statically: in this, the variable can hold only one type, like in Java a variable declared of string can take only set of characters and nothing else.

NOTE: Typescript is a superset of JS which is of typed language.

What does a typeof operator do?

The operator typeof gives the type of a variable/data available in it. The typeof operator can be used on Reference data types also.

Name some of the ways in which Type Conversion is possible.

Type Conversion is to convert from one data type to another data type.

(i) Number to String Conversion.

toString: Other data type to String.
val = (5).toString(); converts integer to string.
val = (true).toString(); converts boolean to string.
Convert from Number/Boolean/Date to String.
Number to String: String(9) converts num to string
Boolean to String: String(true) converts bool to str
Date to String: String(new Date()) date to string
Array to String: String([2,2,2]) Array to string.

(ii) String to Number Conversion.

parseInt: String to Int only (no decimals)
val = parseInt('11'); outputs 100 as number
val = parseFloat('22.22') outputs 22.22 as float
Convert from String/Boolean to Number/Date.
String to Number: Number('9') converts str - num
(9).toFixed(4) gives 9.0000 as the output
Boolean to Number: Number(true) converts to no.
Null to Number: Number(null) converts to no. (0)
Chars to Number: Number('ss') give NaN.
VMWare JavaScript Most Frequently Asked Latest Interview Questions Answers
VMWare JavaScript Most Frequently Asked Latest Interview Questions Answers

What is the difference between Local Storage and Session Storage?

Local Storage will stay until it is manually cleared through settings or program.

Session Storage will leave when the browser is closed.

What is the difference between the keywords var and let?

The keyword var is from the beginning of Javascript; whereas, let is introduced in ES2015/ES6. The keyword let has a block scope; whereas, the keyword var has a functional scope.

What is the difference between the operators '=='  and '==='?

The operator '==' compares the value; whereas, the operator '===' compares both value and type.

What is the difference between null and undefined?

When used the typeof operator on null; i.e., typeof(null), the value is an object. Whereas, when used the typeof operator on undefined; i.e., typeof(undefined), the value would be undefined.

Are Javascript and JScript the same?

No, Javascript was provided by Netscape; whereas, JScript was provided by Microsoft.

Are Typescript and Javascript the same?

Typescript is not the next version of Javascript but is developed by Microsoft and can be taken as a superset to Javascript; the code written in Typescript is later compiled into Javascript. Typescript adds new features like Interfaces, Generics, etc.

Name some of the Javascript frameworks.

There are many Javascript Frameworks available today, but the most commonly used frameworks are:

(i) Angular (ii) React (iii) Vue

Explain the typeof operator.

The operator typeof is an example of Unary Operators, which is used by placing it before its operand; which can be of any type.

What are anonymous functions in Javascript?

An anonymous function allows a developer to create a function that has no name. In other words, anonymous functions can be used to store a bit of functionality in a variable and pass that piece of functionality around.

What is AJAX Control Extender Toolkit?

AJAX Control Toolkit is one of the extenders that are used to extend or add the functionalities of the ASP.NET controls. The extenders use a block of JavaScript code to add new and enhanced capabilities to the ASP.NET controls.

AJAX Control Extender Toolkit is a free download from site.

Where AJAX cannot be used?

Users cannot use AJAX if

If Page need to show in a search engine
If browser does not support JavaScript
If user wants to create secure application

What are the difference between AJAX and Javascript?

The differences between AJAX and JavaScript are as follows:



AJAX sends request to the server and does not wait for the response. It performs other operations on the page during that time JavaScript make a request to the server and waits for response
AJAX does not require the page to refresh for downloading the whole page JavaScript manages and controls a Web page after being downloaded
AJAX minimizes the overload on the server since the script needs to request once JavaScript posts a request that updates the script every time

What are the components of the ASP.NET AJAX architecture?

There are two components of AJAX Architecture:

AJAX client architecture
AJAX server architecture

What are the extender controls?

The extender controls uses a block of JavaScript code to add new and enhanced capabilities to ASP.NET.

What are the pre-requisites to execute AJAX applications on a server?

AJAX is a built-in functionality of .NET Framework 4.0 and AJAX application can be executed by just installing Microsoft Visual Studio 2010. To use extenders in your applications, you are required to install AJAX Control Toolkit and copy the AjaxControlToolkit.dll file to the Bin directory of your application.

Which request is better, Get or Post?

AJAX requests should use an HTTP GET request where the data does not change for a given URL requested.

An HTTP POST should be used when state is updated on the server. This is highly recommended for a consistent web application architecture.

Subscribe to get more Posts :