Best Online Tutorials

SQL Tutorial

Free SQL Tutorial

SQL Interview Questions

SQL Practice Questions

SQL Tips & Tricks

SQL Errors

SQL Books

Angular Tutorial

Free Angular Tutorial

Angular Interview Questions

Angular Practice Questions

Angular Tips & Tricks

Angular Errors

Angular Books

Node.js Tutorial

Free Node.js Tutorial

Node.js Interview Questions

Node.js Practice Questions

Node.js Tips & Tricks

Node.js Errors

Node.js Books

React.js Tutorial

Free React.js Tutorial

React.js Interview Questions

React.js Practice Questions

React.js Tips & Tricks

React.js Errors

React.js Books

SSIS Tutorial

Free SSIS Tutorial

SSIS Interview Questions

SSIS Practice Questions

SSIS Tips & Tricks

SSIS Errors

SSIS Books

SEO Tutorial

Free SEO Tutorial

SEO Interview Questions

SEO Practice Questions

SEO Tips & Tricks

SEO Errors

SEO Books

Javascript Tutorial

Free Javascript Tutorial

Javascript Interview Questions

Javascript Practice Questions

Javascript Tips & Tricks

Javascript Errors

Javascript Books

MongoDB Tutorial

Free MongoDB Tutorial

MongoDB Interview Questions

MongoDB Practice Questions

MongoDB Tips & Tricks

MongoDB Errors

MongoDB Books

Next.js Tutorial

Free Next.js Tutorial

Next.js Interview Questions

Next.js Practice Questions

Next.js Tips & Tricks

Next.js Errors

Next.js Books

JavaScript interview questions | Part 2 

Prashant Surya  |   Oct 22, 2019  |  Views: 261
pictures

Description:

11.  What are the different data types in JavaScript?

Primitive data types:

Boolean
Null
Undefined
Number
BigInt
String
Symbol


Non Primitive data type:

Object


12.  What is the difference between “==” and “===” ?

Abstract Equality Comparison:
”==” only compares values 

Strict Equality Comparison:
“===” compare values and data types both.


13.  What is the use of type of operator?

'Typeof' operator is used to get the data type of the given variable in the string.



14.  what is meant by Dynamic typing in JavaScript?


Whenever a variable is defined in angular it is not directly associated to any particular data type.

It changes its data types accordingly to the type of data assigned or de-assignee to it.

So JavaScript is a loosely typed or a dynamic language.



15.  What is undefined in JavaScript?

Undefined is something that is not defined having no memory space assigned to it.

If a variable has not been assigned a value has the value undefined.



16.  What is an Object in JavaScript?

An object is a collection of properties.

An object is a value in memory which is possibly referenced by an identifier.

In JavaScript, everything is an object, and all are derived from the object only.



17.  What is strict mode in JavaScript?

Syntax 'use strict';

It was introduced in ECMAScript 5.

Benefits of using strict mode:

It eliminates some JavaScript silent errors by changing them to throw errors.

It fixes mistakes that make it difficult for the JavaScript engines to perform the optimizations.



18.  What is the use of static keyword in JavaScript

Static means, that needs not to initialize multiple times.

If a class have a static method:

- we can call it directly using as classsName.staticMethod().
- we can't access that static method from the class instances.

These are often the utility functions, such as the functions to create or clone any objects.

Example: 

class ClassWithStaticMethod 
{
  static staticMethod() {
    return 'You have called a static method.';
   }
}

console.log(ClassWithStaticMethod.staticMethod());

// Output: "You have called a static method."


Static method can be called inside the another static method only. (Using this keyword  --> this.staticMethod())

Static method can't be called inside the normal methods of the same class.


If we want to call the static method inside the non-static method, we have two tricks to use:

- Call it using the Class Name  --> classsName.staticMethod().
- Call it using Constructor of the class --> this.constructor.staticMethod().


19.  What is the difference between var and let in JavaScript?

var keyword was introduced from stating in JavaScript.
Let keyword was introduced later in ES6/ES2015 

Hoisting:
var:  If its been called before initializing, will give undefined.
Let:  If its been called before initializing, will throw reference error.

Scope:
var:  var scope is limited to the function scope or global scope as its defined.
Let:  Let scope is limited to the particular block in which it is defined.

Globally Initialization:
var:  If declared globally, it is added in window object, and can also be accessed by
window.variablename

Let:  If declared globally, it is not added in window object, and if try to access by
window.variablename will throw error: 

Redeclaration:
var:  If re-declared, its value is replaced.
Let:  If re-declared, it will throw error : Identifier has already been declared.


20.  Is JavaScript a case sensitive language?

Yes, a variable with same name having different capitalization of letters will be treated as different variables.







Comments:
Content Contributor
Prashant Surya

Prashant Surya

Software developer at Uniserve Data Technologies Pvt. Ltd.  |   Noida, Uttar Pradesh, India

I am a software developer, freelancer and trainer working on technologies likes. MEAN stack, MERN Stack, ASP.NET full stack, WebRTC, socket.io ,PWA, SQL, JavaScript, jQuery, HTML, CSS, SEO, responsive UI/UX designing... having 7 years of experience in development in multiple domains like, eCommerce, RTA, capital markets, education, real estate...


Read related articles

JavaScript interview questions | Part 2

Prashant Surya  |   Oct 22, 2019  |  Views: 262

JavaScript interview questions | Part 1

Prashant Surya  |   Oct 22, 2019  |  Views: 380

Want to sell your software ?-

If you want to sell your readymade software to the genuine clients or businessman, list your software with details and demo links.

  • Sell ERP
  • Sell Website Clones
  • Sell App Clones
  • Sell Readymade Portals
  • Sell Readymade Websites
  • Sell Mobile Apps
  • Sell Window Apps

Clients will find it using our advanced search filter and will contact you directly.

No any charge for the product lsiting.

Do you own a Company ?+

Property.sale

Buy or Sell Commercial Property+

Are you a freelancer ?+

Looking for a job ?+

Are you a Service Provider ?+

Are you a blogger ?+

Do you own an IT Institute ?+



Property.sale