problem with an javascript inputs in javascript

undefined is return because you do not explicitly return something on that function. If we would do some refactoring, you will see, that it is works as suppossed.

function isPositive(a, b) {
  return (a === 1) && (b === 1) ? 'positive' : false
}

console.log(isPositive(5, 7))
// => false
console.log(isPositive(5, 10))
// => false
console.log(isPositive(5, 6))
// => false
console.log(isPositive(5, 1))
// => false
console.log(isPositive(1, 1))
// => 'positive'

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top