Callback Functions in JavaScript
function mySandwich(param1, param2, callback) { alert('Started eating my sandwich.\n\nIt has: ' + param1 + ', ' + param2); if (callback && typeof(callback) === "function") { callback(); } } mySandwich('ham', 'cheese', 'vegetables');
沒有留言:
張貼留言
留個話吧:)