JavaScript
Unfortunately, JavaScript does not support the square root symbol for function names. Instead, we can use some other Unicode alphabet character to represent a square root function.
In this example I'll use ᕂ.
Once we have a valid symbol to use, we can use the Math object to generate a square root function.
var ᕂ = (function sqrt(_generator_){ return _generator_[arguments.callee.name]; }(Math)); ᕂ(2); // 1.4142135623730951 ᕂ(100); // 10 ᕂ(1337); // 36.565010597564445 It's simple! :)
Of course, it would be easier to just use
var ᕂ = Math.sqrt;