constlikes=(names)=>{constmap=newMap([[0,'no one likes this'],[1,'{name} likes this'],[2,'{name} and {name} like this'],[3,'{name}, {name} and {name} like this'],[4,'{name}, {name} and {n} others like this'],]);returnmap.get(names.length<4?names.length:4).replace(/{name}|{n}/g,(val)=>val==='{name}'?names.shift():names.length);};
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Discussion on: Daily Challenge #266 - Who Likes It?
For further actions, you may consider blocking this person and/or reporting abuse