Create an array to store the linked list from beginning to end, then reverse the array
var reversePrint = function(head) { if(!head) return [] let arr = []; while(head){ arr.push(head.val); head = head.next; } return arr.reverse() };