GoConqr has a new look! Let us know what you think.

Module 15 of 35 · Text

#15

welligton costa

  

/ *

Condicionais

---------------------------------

Escreva uma função para testar se um número fornecido é negativo ou positivo

- se o número for menor que zero, retorna a palavra "negativo"

- se o número for maior ou igual a zero, retorna a palavra "positivo"

* /

 

function negativeOrPositive(number) {

}

/*

DO NOT EDIT BELOW THIS LINE

--------------------------- */

var number1 = 5;

var number2 = -1;

var number3 = 0;

console.log(number1 + " is " + negativeOrPositive(number1));

console.log(number2 + " is " + negativeOrPositive(number2));

console.log(number3 + " is " + negativeOrPositive(number3));

/ *

RESULTADO ESPERADO

---------------

5 é positivo

-1 é negativo

0 é positivo

* /

Instructions

You must submit an attempt for this quiz to progress. You can submit it after the last question.

Go to the chosen module

Feedback

What is it about?

What do you think of the new look?

How do you like it?