Dilettante_Pro,
это?
let list = {
value: 1,
next: {
value: 2,
next: {
value: 3,
next: {
value: 4,
next: null
}
}
}
};
function printList(list) {
var a = list.value;
if (list.next) {
printList(list.next);
}
alert(a);
return a
}
var a = printList(list);