The snake game coded and made in p5.js by using a Double Linked List from the DoubleLinkedListLibJs library
You can try it out here: https://randomgamingdev.github.io/Snakep5js/
DoubleLinkedListLibJs: https://github.com/RandomGamingDev/DoubleLinkedListLibJs/