0
Day or night?
-This version worked on Chrome, but not on SoloLearn? function main(hour){ if (hour >= 0 && hour<=12){ return "am"; }else{ return "pm"; } } console.log(main(12)); //Returned "am". console.log(main(14)); //Returned "pm". console.log(main(8)); //Returned "am".
4 Respostas
+ 1
hour = +hour;
// at start of main should work
// (implicite to number conversion)
+ 1
your code works on sololearn web code playground:
https://code.sololearn.com/W1N8i6AhLcq0/?ref=app
what do you expect as output?
0
Pass number to function instead of string
0
It only passes one number at a time and then tells me the other is an error? Is there a way to add a screen shot?