Beginner

Check if a Number is Positive, Negative, or Zero in JavaScript

Description

In JavaScript, you can use conditional statements to make decisions in your code.

For example, you can check if a number is positive, negative, or zero and perform different actions based on the result.

In this challenge, you will write a function named checkNumberSign that takes a number as input and returns a string indicating whether the number is "Positive", "Negative", or "Zero".

Example Usage:

console.log(checkNumberSign(5)); // Expected output: "Positive" console.log(checkNumberSign(-3)); // Expected output: "Negative" console.log(checkNumberSign(0)); // Expected output: "Zero"

Constraints:

  • The input will always be a number.
  • The function should return one of the following strings: "Positive", "Negative", or "Zero".

window code 2Test Cases

Input:

5

Expected Output:

"Positive"