and Answers Already Passed
What does `typeof` do in JavaScript?
✔✔ It returns the data type of a value
How do you create a function in JavaScript?
✔✔ Using the `function` keyword or arrow syntax
What will `5 + "5"` return in JavaScript?
✔✔ `"55"` (string concatenation)
How do you convert a string to a number in JavaScript?
✔✔ Using `parseInt()`, `parseFloat()`, or `Number()`
What is an array in JavaScript?
✔✔ A collection of elements stored in square brackets
1
,How do you add an element to the end of an array?
✔✔ Using `push()`
How do you remove the last element from an array?
✔✔ Using `pop()`
What is the purpose of a loop in JavaScript?
✔✔ To repeat a block of code multiple times
How do you write a `for` loop in JavaScript?
✔✔ `for (let i = 0; i < 10; i++) {}`
What is an object in JavaScript?
✔✔ A collection of key-value pairs
How do you access a property of an object?
✔✔ Using dot notation or bracket notation
2
, What does `null` mean in JavaScript?
✔✔ It represents an intentional absence of value
What does `undefined` mean in JavaScript?
✔✔ A variable that has been declared but not assigned a value
How do you check if an array contains an element?
✔✔ Using `includes()`
What is JavaScript used for in web development?
✔✔ To create interactive and dynamic web pages
How do you declare a variable in JavaScript?
✔✔ Using `let`, `const`, or `var`
What keyword is used to define a constant variable?
✔✔ `const`
3