Q: What is JavaScript, and how is it different from Java?
JavaScript is a lightweight, interpreted programming language primarily used for web development.
Unlike Java, which is compiled and strongly typed, JavaScript is interpreted and dynamically typed.
[Link]('Hello, JavaScript!');
Q: What are data types available in JavaScript?
Primitive types include string, number, boolean, undefined, null, bigint, and symbol. Non-primitive:
object, array, function.
let str = 'Hello'; let num = 10; let obj = {};
Q: Difference between let, const, and var?
`var` is function-scoped, `let` and `const` are block-scoped. `const` cannot be reassigned.
var a=1; let b=2; const c=3;
Q: What is hoisting?
Hoisting moves declarations to the top of their scope before code execution.
[Link](a); var a = 5; // undefined
Q: What is a closure?
A closure gives a function access to variables from its parent scope even after that scope has
closed.
function outer(){let x=10;return function(){[Link](x);}} const
inner=outer(); inner();
...and more (Total 50 Questions with detailed code examples).