JavaScript

From Han Wiki
Revision as of 21:57, 2 April 2016 by Mhan (talk | contribs)

Jump to navigation Jump to search

examples

Math.max(2,4); // 4
Math.min(2,4) + 100; // 102
confirm("Shall we, then?"); // OK, Cancel
prompt("Tell me everything you know.","..."); // default "..." OK, Cancel
print("X"); // print to printer
// 
var theNumber = Number(prompt("Pick a number", ""));
if (!isNaN(theNumber))
   alert("Your number is the square root of " + (theNumber * theNumber));