Last active
October 9, 2018 11:34
-
-
Save onurkerimov/ae82972515cc4c0d6cc2b1f890dca981 to your computer and use it in GitHub Desktop.
A template for using the functions and variables in native Math object, without writing "Math." at the beginning, also "print" is the alias for "console.log"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(print, abs, acos, acosh, asin, asinh, atan, atanh, | |
atan2, ceil, cbrt, expm1, clz32, cos, cosh, exp, floor, | |
fround, hypot, imul, log, log1p, log2, log10, max, min, | |
pow, random, round, sign, sin, sinh, sqrt, tan, tanh, | |
trunc, E, LN10, LN2, LOG10E, LOG2E, PI, SQRT1_2, SQRT2) { | |
// Function Body | |
})(console.log, Math["abs"], Math["acos"], Math["acosh"], Math["asin"], | |
Math["asinh"], Math["atan"], Math["atanh"], Math["atan2"], Math["ceil"], | |
Math["cbrt"], Math["expm1"], Math["clz32"], Math["cos"], Math["cosh"], | |
Math["exp"], Math["floor"], Math["fround"], Math["hypot"], Math["imul"], | |
Math["log"], Math["log1p"], Math["log2"], Math["log10"], Math["max"], | |
Math["min"], Math["pow"], Math["random"], Math["round"], Math["sign"], | |
Math["sin"], Math["sinh"], Math["sqrt"], Math["tan"], Math["tanh"], | |
Math["trunc"], Math["E"], Math["LN10"], Math["LN2"], Math["LOG10E"], | |
Math["LOG2E"], Math["PI"], Math["SQRT1_2"], Math["SQRT2"]); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternative version (no need for function wrapper)