4. switch


#1


var user = prompt("what is your name").toUpperCase();

switch(user) {
    case 'FAREEDAT':
        console.log("hey fareedat!");
        break;
    case 'COMPUTER':
        console.log("are you a robot?");
        break;
    case 'DANIEL':
        console.log("Daniel isnt bad");
        break;
    case 'MERCY':
        console.log("where are you");
        break;
    default:
       console.log("sorry you dont exist");



its not working ...dont know what am doing wrong.


#2

Remember to close the code block.

switch(user) {

}

#3

thanks xo much...javascript needs all the attention:relaxed:


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.