hadleKeyFactory = function() {
var result = '';
return function(key) {
return (result += key);
}
}
var handleKey = new hadleKeyFactory();
handleKey('a');
// output 'a'
handleKey('b')
// output 'ab'
a.draw().figure()
- это то же самое, что иvar drawResult = a.draw();
drawResult.figure();
a = new ExampleObjeact();
a.makeSomething = function(action) {
return a[action]();
});
a.makeSomething('makeSome1');
a.makeSomething('makeSome2');
a.makeSomething('makeSome3');