QUESTION IMAGE
Question
what will output to the console log? var hug; var hawks; hawks = 35; hug = 19; hawks = 19; hug = 35; console.log(hawks); options: 19, \hawks\, 35, \hug\
Step1: Analyze the Code Snippets
Looking at the code (from the image), we have variables: var hug;, var hawks;, hawks = 35;, aug = 19;, hawks = 19;, hug = 35;, and then console.log(hawks);.
Step2: Determine the Value of hawks
We need to find the final value of the variable hawks before the console.log statement. Let's track the assignments:
- First,
hawks = 35;(line 3) - Then,
hawks = 19;(line 5)
So the last assignment to hawks is 19, so when we do console.log(hawks), it will output the current value of hawks, which is 19.
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
19