JavaScript Math sign() method18 Mar 2025 | 1 min read The JavaScript math sign() method returns the sign of the number. It indicates whether the given number is positive, negative or zero. SyntaxThe sign() method is represented by the following syntax: Parameternum - A number. ReturnThe sign of the given number. JavaScript Math sign() method exampleHere, we will understand sign() method through various examples. Example 1Let's see an example to find out the sign of the given number. Output: 1 -1 0 Example 2Let's see some cases where sign() method returns NaN. Output: NaN NaN NaN Example 3Here, you can test sign() method with your own test cases. Next TopicJavaScript Math |
We request you to subscribe our newsletter for upcoming updates.

We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India