Cool I did this one 3 years ago over at CodeWars, here is the answer I posted:
functionlikes(names){switch(names.length){case0:return`no one likes this`;break;case1:return`${names[0]} likes this`;break;case2:return`${names[0]} and ${names[1]} like this`;break;case3:return`${names[0]}, ${names[1]} and ${names[2]} like this`;break;default:return`${names[0]}, ${names[1]} and ${names.length-2} others like this`;}}
Cool I did this one 3 years ago over at CodeWars, here is the answer I posted:
Looking at it now,
break
is not needed, as return breaks out of the switch statement.