Skip to content

Instantly share code, notes, and snippets.

View web-dev-london's full-sized avatar
👨‍💻
Coding

web-dev-london

👨‍💻
Coding
View GitHub Profile
@jonurry
jonurry / 4-3 Eloquent Javascript Solutions.js
Last active July 17, 2022 10:57
4.3 A List (Eloquent JavaScript Solutions)
function arrayToList(array) {
let result = {};
if (Array.isArray(array)) {
let currListItem = result;
for (let item of array) {
let newListItem = {
value: item,
rest: null
};
if (typeof currListItem.rest === 'undefined') {