10 JavaScript interview questions frequently asked.!

1. what is JavaScript?
JavaScript is an Interpreted, High-level, Scripting language. mostly used in Web programming. Prototype-based object-oriented. Can create awesome interactive web-app or website. It can be just-in-time compiled or multi-paradigm.

2. What is the difference between ‘var’ vs ‘const’ vs ‘let’?
var — ‘var’ is a reserved keyword in JS. It passes one/many values to the function when arguments are declared. Otherwise, it will return “null”/”undefined”. ‘var’ is declared in the global or local scope. value can be reassigned.

const — when you need to redeclare the variable since ‘const’ doesn’t let you do that. It’s block-scoped.

let — ‘let’ is likely ‘var’, which can be reassigned. the preferred variable declaration now. should be the improved method of ‘var’. it also a block-scoped declared.

3. Is JavaScript case sensitive?
Yeah, JS is a case-sensitive language. Keywords, variables, function names, identifiers are capitalized letters.

4. How does typeOf Operator work?
TypeOf Operator is used to get data types of its operand. As a unary operator, it is placed before a single operand.

5. How to create and read cookies in JavaScript?
By assigning a string value to the ‘document.cookie’ object.
Reading a cookie is just as simple as writing one because of the value of the document.cookie object is the cookie. So you can use this string whenever you want to access the cookie.

6.What is the difference between Attributes and Property?
Attributes- provide more details on an element like id, type, value, etc.
Property- is the value assigned to the property like type=”text”, value=’Name’ etc.

7.How to add JS in HTML file?
In three ways you can add or use JS in HTML:
-Inline, -Internal, -External;

8. What is the difference between Local storage and Session storage?
Local Storage — Data load the first time and don’t send back to the server on every HTTP request. Stay until the program is manually reset/ cleared.

Session Storage — Also store data when requested. but automatically clear data as soon as the page session ends.

9. Name of some JavaScript frameworks and Libraries.
Angular, React, Vue.

10. What is the strict mode?
Strict mode is a better way to handle error checking in code. Add strict typing-” strict mode” at the beginning of a file, program, or function.




JavaScript Developer | React Developer | Frontend Developer | NodeJs | Designer | Remote |

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Introduction to Vuex in Vue.js

JavaScript: Async and Await

Algorithm Time: Are There Duplicates?

Authentication using JSON Web Token, Node JS and Express JS

What Is DangerouslySetInnerHTML?

React Native Super Blazing Fast UI Building Techniques Part 1 — Storybook

Prototype Pattern in TypeScript

How To Learn Javascript Faster And Effectively

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mohaiminul Islam

Mohaiminul Islam

JavaScript Developer | React Developer | Frontend Developer | NodeJs | Designer | Remote |

More from Medium

Behaviour of ‘This’ Keyword in Regular and Arrow Functions in Javascript.

One time array loop

Basics in JavaScript

Polyfill for map, filter and reduce in Javascript