Skip to content

Instantly share code, notes, and snippets.

View MrVanQish's full-sized avatar
🐊
Nada puede malir sal

Jacobo Hernandez Echeverry MrVanQish

🐊
Nada puede malir sal
View GitHub Profile
@MrVanQish
MrVanQish / likes.ts
Last active November 12, 2022 18:11
Array de personas que han reaccionado a un post para retornar un string con info
const likesPerPeople = (peopleArray: Array<string>): string => {
switch (peopleArray.length) {
case 0:
return 'No one like this';
case 1:
return peopleArray[0] + ' likes this';
case 2:
return peopleArray[0] + ' and ' + peopleArray[1] + ' like this';
case 3:
return peopleArray[0] + ', ' + peopleArray[1] + ' and ' + peopleArray[2] + ' like this';