10 JavaScript interview questions frequently asked.!

Mohaiminul Islam
2 min readMar 8, 2021

--

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.

--

--

Mohaiminul Islam
Mohaiminul Islam

Written by Mohaiminul Islam

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

No responses yet