JenMorgan / js-learning

0 stars 0 forks source link

Write a JavaScript program to check from two given integers, whether one is positive and another one is negative #10

Open kartamyshev opened 4 years ago

JenMorgan commented 4 years ago
let checkThePossitive = (num1, num2) => {
    let result;
    if (num1 > 0) {
        (num2 < 0) ? result = num1 : result = "Both are possitive";
        return result;
    }
    (num2 > 0) ? result = num2 : result = "Both are negative";
    return result;
}

alert(checkThePossitive(-60,-205));