Editor Arrow Download Open
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>JavaScript non strict mode with statement</title> </head> <body> <pre> <!-- Use pre element for work document.writeln() method --> <script type="text/javascript"> var val = 4, radius, root, power; with (Math) { radius = PI * val * val; root = sqrt(val); power = pow(val, 3); } document.writeln("Radius: " + radius); document.writeln("Square root: " + root); document.writeln("Power: " + power); </script> </pre> </body> </html>
  Preview Arrow