Notitie
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen u aan te melden of de directory te wijzigen.
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen de mappen te wijzigen.
Returns the absolute value of a number.
Syntax
Math.abs(number)
Remarks
The required number argument is a numeric expression for which the absolute value is needed.
The return value is the absolute value of the number argument.
The following example illustrates the use of the abs method.
function ComparePosNegVal(n)
{
var s;
var v1 = Math.abs(n);
var v2 = Math.abs(-n);
if (v1 == v2)
s = "The absolute values of " + n + " and "
s += -n + " are identical.";
return(s);
}
Requirements
Applies To: Math Object (Windows Scripting - JScript)