SayHello code example
Example 1: SayHello
function throttle( fn, time ) {
var t = 0;
return function() {
var args = arguments, ctx = this;
clearTimeout(t);
t = setTimeout( function() {
fn.apply( ctx, args );
}, time );
};
}
Example 2: SayHello
function sayHello(){
console.log("sayHello");
}