with Verified Solutions
How can you access the first element of an array in JavaScript?
✔✔A) array[0]
B) array[1]
C) array.first()
D) array(0)
What will this code print?
```
let x = 10;
console.log(x * 2);
```
A) 10
✔✔B) 20
C) undefined
D) Error
1
, What does the `return` statement do in a function?
A) Exits the function without returning a value
B) Prints the value to the console
✔✔C) Exits the function and returns a value
D) Loops through the function
Which of these is a correct way to define a function in JavaScript?
A) function myFunction: {}
✔✔B) function myFunction() {}
C) def myFunction() {}
D) function = myFunction() {}
What does the `let` keyword do in JavaScript?
✔✔A) Declares a block-scoped variable
B) Declares a global variable
2