JS, with each case defined. I went for straightforward, though there's probably room to condense this somehow given the repetition:
constlikes=names=>{switch(names.length){case0:return"no one likes this"case1:return`${names[0]} likes this`case2:return`${names[0]} and ${names[1]} like this`case3:return`${names[0]}, ${names[1]} and ${names[2]} like this`default:return`${names[0]}, ${names[1]} and ${names.length-2} others like this`}}
JS, with each case defined. I went for straightforward, though there's probably room to condense this somehow given the repetition:
lol great minds think alike