Is it possible to call recursively a method from an object literal?
For example:
(function () {
'use strict';
var abc = ['A', 'B', 'C'],
obj = {
f: function () {
if (abc.length) {
abc.shift();
f(); // Recursive call
}
}
};
obj.f();
}());
Error: 'f' was used before it was defined.
Thanks.