JavaScript math sign() method
The JavaScript math sign() method is used to get the sign of a number. Syntax: Math.sign(n) Parameters n: It represents the number whose sign has to be get. Returns Sign of a number. Example: <!DOCTYPE html> <html> <body> <script> document.writeln(Math.sign(-6)); </script> </body> </html>