递归
var printListReversingly = function(head) {
if (head === null) return []
return [].concat(printListReversingly(head.next),head.val)
}
遍历unshift
var printListReversingly = function(head) {
let p = head
let res = []
while (p) {
res.unshift(p.val)
p = p.next
}
return res
}