How well Do u Know Javascript?

How well Do u Know Javascript?

Lets see how many of the following Questions can u solve?

  1. Is Javascript a programming or scripting language?

  2. When was javascript founded and by whom?

  3. Is Javascript Interpreted or Compiled language?

  4. Is Javascript statically typed or dynamically typed and why?

  5. What is the difference between let, const, and var in JavaScript?

  6. How do you add a comment in JavaScript?

  7. What are the different data types in JavaScript?

  8. How do you declare a function in JavaScript?

  9. What is the purpose of the "this" keyword in JavaScript?

  10. How do you check if a value is an array in JavaScript?

  11. What is the difference between null and undefined in JavaScript?

  12. How do you access the elements of an array in JavaScript?

  13. What is the purpose of the "use strict" directive in JavaScript?

  14. How do you create an object in JavaScript?

  15. What will be the output of console.log(typeof null)?

  16. How do you check if a variable is an array or not?

  17. Explain the difference between let and var.

  18. What is the purpose of the spread operator (...) in JavaScript?

  19. How do you add an event listener to an HTML element in JavaScript?

  20. What is the difference between arrow functions and regular functions?

  21. What is the purpose of the "use strict" directive?

  22. What is the difference between synchronous and asynchronous code?

  23. What is the purpose of the map() method in JavaScript?

  24. How do you create a promise in JavaScript?

  25. What is the difference between let and const?

  26. What is the purpose of the filter() method in JavaScript?

  27. What is the difference between == and === operators?

  28. How do you loop through an object in JavaScript?

  29. What is the purpose of the reduce() method in JavaScript?

  30. What is the difference between slice() and splice() methods for arrays?

  31. How do you check if a variable is undefined or null in JavaScript?

  32. What will be the output of the following code?

var y = 1;
let x = y = 2;
console.log(x, y);
  1. What will be the output of the following code?
function getAge(...args) {
  console.log(typeof args);
}

getAge(21);
  1. What will be the output of the following code?
console.log(typeof typeof 1);
  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);
  1. 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);
}
  1. What will be the output of the following code?
javascriptCopy codeconsole.log(typeof null);
  1. What will be the output of the following code?
let x = 23;

(function() {
  let x = 45;
  console.log(x);
})();

console.log(x);
  1. What will be the output of the following code?
const arr = [10, 20, 30];
arr[100] = 40;
console.log(arr.length);
  1. 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);
  1. What will be the output of the following code?
console.log(Math.max());

Did you find this article valuable?

Support Thirumalai by becoming a sponsor. Any amount is appreciated!