0

Necesito ayuda con este código

function main() { var year = parseInt(readLine(), 10); var month = parseInt(readLine(), 10); var day = parseInt(readLine(), 10); console.log(getWeekDay(year, month, day)); } function getWeekDay(year, month, day) { var names = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; var d = new Date(year, month, day); //completa la función var days = d.getDay() switch (days) { case 0: console.log(names[0]); break; case 1: console.log(names[1]); break; case 2: console.log(names[2]); break; case 3: console.log(names[3]); break; case 4: console.log(names[4]); break; case 5: console.log(names[5]); break; case 6: console.log(names[6]); break; } }

29th Jul 2021, 10:16 AM
[No Name]
1 Réponse
+ 4
No ha definido un valor de retorno al final de su función. o prueba esto function main(){ variables de entrada getWeekDay(year, month, day); } ...
29th Jul 2021, 12:41 PM
Simba
Simba - avatar