Best Practices for Transforming Array of Objects into Nested Objects in JavaScript
Hi I have a question about best practices:
What is the recommend way to have a function that gets as an input [{value: "a"},{value:" b"}, {value:"c"} ] and returns {value: "a", next: {value: "b" , next: {value: "c"}}
I can use simple js reduce but I wonder if there is a better approach to do so in effect (maybe using stream unfold)
What is the recommend way to have a function that gets as an input [{value: "a"},{value:" b"}, {value:"c"} ] and returns {value: "a", next: {value: "b" , next: {value: "c"}}
I can use simple js reduce but I wonder if there is a better approach to do so in effect (maybe using stream unfold)
