Javascript Interview Questions!

Javascript is becoming the most popular scripting language and with its most powerful Frameworks and libraries.

Here are some Javascript Interview Questions, to help you with JS

🧵Thread🧵

RT and Like if you liked!

#100DaysOfCode
Q1. What is the difference between Java & JavaScript?

- Java is an OOP programming language, It creates applications that run in a virtual machine or browser.

JavaScript is an OOP scripting language, The code is run on a browser only.

#100DaysOfCode
Q2. What is JavaScript?

- JavaScript is a lightweight, interpreted programming language with object-oriented capabilities that allows you to build interactivity into otherwise static HTML pages.

#100DaysOfCode
Q3. What are the data types supported by JavaScript?

- Undefined
Null
Boolean
String
Symbol
Number
Object

#100DaysOfCode
Q4. What are the features of JavaScript?

- It is a lightweight, interpreted programming language.
It is designed for creating network-centric applications.
It is complementary to and integrated with Java.
It is an open and cross-platform scripting language.

#100DaysOfCode
Q5. Is JavaScript a case-sensitive language?

- Yes, JavaScript is a case sensitive language. The language keywords, variables, function names, and any other identifiers must always be typed with a consistent capitalization of letters

#100DaysOfCode
Q6. How can you create an object in JavaScript?

- var emp = {
name: "Daniel",
age: 23
};

#100DaysOfCode
Q7. Can you assign an anonymous function to a variable and pass it as an argument to another function?

- Yes! An anonymous function can be assigned to a variable. It can also be passed as an argument to another function.

#100DaysOfCode
Q8. What is Callback?

- A callback is a plain JavaScript function passed to some method as an argument or option. It is a function that is to be executed after another function has finished executing, hence the name ‘call back‘.

#100DaysOfCode
Q9. What is the purpose of ‘This’ operator in JavaScript?

The JavaScript this keyword refers to the object it belongs to. This has different values depending on where it is used. In a method, this refers to the owner object and in a function, this refers to the global object.
Q10. What is Closure? Give an example.

Closures are created whenever a variable that is defined outside the current scope is accessed from within some inner scope. It gives you access to an outer function’s scope from an inner function.

#100DaysOfCode
Q11. List out the different ways an HTML element can be accessed in a JavaScript code.

(i) getElementById(‘idname’)
(ii) getElementsByClass(‘classname’)
(iii) getElementsByTagName(‘tagname’)
(iv) querySelector()

#100DaysOfCode
Q12. What are the ways to define a variable in JavaScript?

- Var
Const
Let

#100DaysOfCode
Q13. What is the difference between the operators ‘==‘ & ‘===‘?

The main difference between “==” and “===” operator is that formerly compares variable by making type correction

#100DaysOfCode
Q14. What is the difference between window & document in JavaScript?

- JavaScript window is a global object which holds variables, functions, history, location.
The document also comes under the window and can be considered as the property of the window.

#100DaysOfCode
You can follow @_born_may.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: