+ 1
i need help with practice 4.2/even numbers/overview/javascript
4 Respostas
+ 2
//console.log("1. James")
console.log("2. John")
//console.log("3. Amy")
console.log("4. Collin")
//console.log("5. Tom")
console.log("6. Lisa"
Here is your answer
Anything after // will be ignored so you have to remove // for even or odd number as per your question
0
Sorry no one has responded to this yet. I’m guessing you question has been overlooked because there wasn’t enough info.
Please explain in detail what you need help with. That is, if you still need help. Someone will try to assist you once more info is provided.
0
/*There are 2 ways to go about this.. the first a more simple way as NIKHIL SONAWANE stated above I'll drop the tenny weeny complex and fun answer below..
*/
Var user = prompt('Input Number');
Var Odd = (user%2 != 0) ? alert(`${user} is an Odd Number`) : alert(`${user} is an Even number`);
/* the above simply uses a ternary operator to get an even/odd sequence I'm considering using it in the famous guy "fizzbuzz" challenge...🙂*/
0
//console.log("1. James")
console.log("2. John")
//console.log("3. Amy")
console.log("4. Collin")
//console.log("5. Tom")
console.log("6. Lisa")
Good Luck