Rated A+
How do you declare a variable in JavaScript?
✔✔You declare a variable using `let`, `const`, or `var`.
What is the difference between `let` and `const` in JavaScript?
✔✔`let` allows you to reassign a variable, while `const` makes it immutable.
How do you create a function in JavaScript?
✔✔You create a function using the `function` keyword followed by a name and parentheses.
What is an array in JavaScript?
✔✔An array is a collection of elements stored in a single variable.
How do you access the first element of an array in JavaScript?
✔✔You access it using `array[0]`.
1
, What does the `push()` method do in JavaScript?
✔✔The `push()` method adds an element to the end of an array.
How do you remove the last element of an array?
✔✔You use the `pop()` method.
What is the purpose of the `if` statement in JavaScript?
✔✔The `if` statement is used to execute code only if a specified condition is true.
How do you create a loop in JavaScript?
✔✔You use a `for` loop, `while` loop, or `do...while` loop.
What is the difference between `==` and `===` in JavaScript?
✔✔`==` checks for value equality, while `===` checks for value and type equality.
How do you define an object in JavaScript?
✔✔You define an object using curly braces `{}` with key-value pairs.
2