var Test = {};
Test.a = {
Name: 'Vasya',
toString: function() {return "Hello";}
}
function getForFunction(obj, callback) {
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
callback(obj[key]);
}
}
}
getForFunction({a: 1, b: 2, c: 3}, function( i ){
console.log(i);
});
var timeoutID;
$('#btn').click(function () {
test();
});
function test() {
clearTimeout(timeoutID);
timeoutID = setTimeout(function () {
console.log('1');
}, 3000);
}