The specification does not determine what properties Math
functions are defined with. Apparently, most implementations apply DontEnum
to these functions, which means that they will not be displayed in the object when repeated using the for(i in Math)
loop.
May I ask why you need to do this? There are not many functions, so itβs best to just define them in an array:
var methods = ['abs', 'max', 'min', ...etc.];
James source share