Consider the following game: A player rolls two six-sided dice. If the first roll (sum of the two dice) is 7, the result is a draw. If it is anything other than a 7, the player continues to roll the dice until the first result is repeated (in which case the player wins) or a 7 is rolled (in which case the player loses). Given the die rolls recorded in a linked list, return the strings "draw", "win" or "loss" as appropriate. Form of linked list containing the rolls 8 and then 7:

var cell2 = { data: 7, next: null };
var cell1 = { data: 8, next: cell2 };

javascript programming
exercise: lists 03