79360029

Date: 2025-01-16 00:03:00
Score: 2
Natty:
Report link

const cards = ['Jack', 8, 2, 6, 'King', 5, 3, 'Queen', "Jack", "Queen", "King"]

const cardOrder = {2:1, 3:2, 4:3, 5:4, 6:5, 7:6, 8:7, 9:8, 10:9, 'Jack': 10, "Queen":11, "King": 12}

const sortedCards = [...new Set(cards)].sort((a,b) => cardOrder[a] - cardOrder[b])

console.log(sortedCards)

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Akindoju