Lets see how many of the following Questions can u solve?
Is Javascript a programming or scripting language?
When was javascript founded and by whom?
Is Javascript Interpreted or Compiled language?
Is Javascript statically typed or dynamically typed and why?
What is the difference between let, const, and var in JavaScript?
How do you add a comment in JavaScript?
What are the different data types in JavaScript?
How do you declare a function in JavaScript?
What is the purpose of the "this" keyword in JavaScript?
How do you check if a value is an array in JavaScript?
What is the difference between null and undefined in JavaScript?
How do you access the elements of an array in JavaScript?
What is the purpose of the "use strict" directive in JavaScript?
How do you create an object in JavaScript?
What will be the output of console.log(typeof null)?
How do you check if a variable is an array or not?
Explain the difference between let and var.
What is the purpose of the spread operator (...) in JavaScript?
How do you add an event listener to an HTML element in JavaScript?
What is the difference between arrow functions and regular functions?
What is the purpose of the "use strict" directive?
What is the difference between synchronous and asynchronous code?
What is the purpose of the
map()
method in JavaScript?How do you create a promise in JavaScript?
What is the difference between
let
andconst
?What is the purpose of the
filter()
method in JavaScript?What is the difference between
==
and===
operators?How do you loop through an object in JavaScript?
What is the purpose of the
reduce()
method in JavaScript?What is the difference between
slice()
andsplice()
methods for arrays?How do you check if a variable is undefined or null in JavaScript?
What will be the output of the following code?
var y = 1;
let x = y = 2;
console.log(x, y);
- What will be the output of the following code?
function getAge(...args) {
console.log(typeof args);
}
getAge(21);
- What will be the output of the following code?
console.log(typeof typeof 1);
- What will be the output of the following code?
const person = {
name: "John",
age: 30,
city: "New York",
toString: function() {
return `${this.name} is ${this.age} years old and lives in ${this.city}`;
}
};
console.log(person.toString());
console.log(person);
- What will be the output of the following code?
const arr = [10, 12, 15, 21];
for (var i = 0; i < arr.length; i++) {
setTimeout(function() {
console.log("Index: " + i + ", value: " + arr[i]);
}, 3000);
}
- What will be the output of the following code?
javascriptCopy codeconsole.log(typeof null);
- What will be the output of the following code?
let x = 23;
(function() {
let x = 45;
console.log(x);
})();
console.log(x);
- What will be the output of the following code?
const arr = [10, 20, 30];
arr[100] = 40;
console.log(arr.length);
- What will be the output of the following code?
const obj = { a: 1, b: 2 };
const copy = { ...obj };
copy.a = 3;
console.log(obj.a, copy.a);
- What will be the output of the following code?
console.log(Math.max());