JavaScript, ES6 spread 语法
/**
* Definition for singly-linked list.
* function ListNode(val) {
* this.val = val;
* this.next = null;
* }
*/
/**
* @param {ListNode} head
* @return {Number[]}
*/
var printListReversingly = function(head) {
return head ? [...printListReversingly(head.next), head.val] : [];
}