Multiple choice technology architecture

JavaScript Function to find SquareRoot?

  1. Var y = Math.sqrt(16);

  2. Var x = Maths.sqrt(16);

  3. Var z = Math.squareroot(16);

  4. Var y = Maths.squareroot(16);

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

The Math object provides sqrt() as the correct method name. Option B and D use 'Maths' which doesn't exist. Option C uses 'squareroot' which is incorrect - the method is 'sqrt'. Option A correctly uses Math.sqrt() with proper capitalization.