QUESTION IMAGE
Question
question: 1
a store has 20 apples in its inventory. how can you store this information in a javascript variable?
- let numapples == 20;
- 20 = numapples;
- let numapples = 20;
- let num apples = 20;
Brief Explanations
To store a value in a JavaScript variable, we use the assignment operator =, not the comparison operator == or ===. Also, variable names cannot have spaces (so num apples is invalid). The correct syntax is let variableName = value;. So let numApples = 20; follows the correct variable declaration and assignment rules.
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
C. let numApples = 20;