0
I sm havi problem o run this code please help
function third(){ switch (C) {case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12 :alert("Thanks for giving your class"); break; default:alert("Evter a valid class") return third();};} third();
8 Answers
+ 1
Insert let C... to your function, delete return third(), add all cases for case 1...11. cases should be like / case '1': case '2': /
becouse prompt give you string value
+ 1
Thanks very much
0
I am having problem to run this code
0
Hi! Just put to the function parameter.
0
Really let I try
0
It is not working appropriate or well please once you also try
0
you don't have a C variable defined inside the function. you didn't initialize it
0
let C =prompt("Write your class");
function third(){
switch (C)
{case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12
:alert("Thanks for giving your class");
break;
default:alert("Evter a valid class")
return third();};}
third();