Multiple choice technology programming languages

What is the output of the below JavaScript?


with(Math){               
     alert(pow(2,3));       
}   

  1. 8

  2. 9

  3. error

  4. 6

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The with(Math) statement extends the scope chain for the block, allowing direct access to math functions. Thus, pow(2,3) executes Math.pow(2, 3) and correctly returns 8.