Some functional languages implement a list data structure in a nested/recursive way.
Node1->Node2->Node3
can be represented using arrays as
[Node1, [Node2, [Node3, []]]]
in JS.
In list.js
you can see some example methods to create and work with such list types as well as some helper functions I've borrowed to help with data transformation process.
JSFiddle here: https://jsfiddle.net/Lhvrsfoy/