Parameters or Arguments
The number to test for its sign.
The sign() feature returns 1 if the range is increased than zero
The sign() characteristic returns 0 if the range is equal to zero
The sign() characteristic returns -1 if the variety is less than 0
Math is a placeholder object that includes mathematical functions and constants of which sign() is one of these functions.
console.log(Math.sign(32)); console.log(Math.sign(0)); console.log(Math.sign(-4));
In this example, we have invoked the sign() feature the use of the Math class.
We have written the output of the sign() function to the internet browser console log, for demonstration purposes, to exhibit what the sign() function returns.
The following will be output to the internet browser console log:
1 0 -1
In this example, the first output to the console log returned 1 on the grounds that the value 32 is a variety larger than 0 (ie: a high quality number).
The 2d output to the console log lower back 0 considering the fact that the value 0 is equal to 0
The third output to the console log again -1 considering the fact that the fee -4 is a number much less than zero (ie: a poor number).