Skip to content

Instantly share code, notes, and snippets.

View Kata
Cons.fromArray = function(array) {
array = array.reverse();
let last = new Cons(array.shift(), null);
array.forEach(function(item) {
last = new Cons(item, last);
});
return last;
}
You can’t perform that action at this time.