var list = {
value:1,
next: {
value: 2,
next: {
value: 3,
next: {
value: 4,
next: null
}
}
}
}
function showList(list) {
alert(list.value);
if(list.next != null) {
showList(list.next);
}
}
showList(list);
dmFyIGxpc3QgPSB7Cgl2YWx1ZToxLAoJbmV4dDogewoJCXZhbHVlOiAyLAoJCW5leHQ6IHsKCQkJdmFsdWU6IDMsCgkJCW5leHQ6IHsKCQkJCXZhbHVlOiA0LAoJCQkJbmV4dDogbnVsbAoJCQl9CgkJfQoJfQp9CgpmdW5jdGlvbiBzaG93TGlzdChsaXN0KSB7CglhbGVydChsaXN0LnZhbHVlKTsKCWlmKGxpc3QubmV4dCAhPSBudWxsKSB7CgkJc2hvd0xpc3QobGlzdC5uZXh0KTsKCX0KfQoKc2hvd0xpc3QobGlzdCk7