QUESTION IMAGE
Question
question: 1
what will the following code print to the screen?
console.log(2 + 2);
- 2 + 2
- 4
- 22
- nothing
question: 2
what symbol do you use to do division in javascript?
- %
- /
- //
- *
Response
Question 1
Brief Explanations
In JavaScript, console.log(2 + 2) evaluates the expression 2 + 2 first, which is 4, and then prints that result. So the code will output 4.
Brief Explanations
In JavaScript, the symbol used for division is /. The % is for modulus (finding the remainder), // is not the division operator in basic JavaScript (it can be used for integer division in some contexts but not the standard division), and * is for multiplication.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
B. 4