There is one possible workaround for using switch
in the cases like yours:
var user = prompt("What is your name?").toLowerCase();
switch (true) {
case (user === "luka"):
console.log("What a beautiful name, my name is exactly the same :) Hi Luka! :D");
break;
case (user.length > 10):
console.log("That's a long name!");
break;
case (user.length < 4):
console.log("Not to be rude or impolite to you in any way, but your name is kinda short :( Not that it isn't cool or something :D");
}
However I'd follow @epascarello's advice and use if/else
blocks.