"use strict";
var printListM = function(obj) {
while (obj.next) {
obj = obj.next;
}
alert(obj.value);
};
var printListR = function(obj) {
alert(obj.value);
if (obj.next != undefined) {
printListR(obj.next);
}
};
var list = {value: 1};
list.next = {value: 2};
list.next.next = {value: 3};
list.next.next.next = {value: 4};
printListR(list);