RcBuilder@walla.com
call centre: 054-5614020

javascript callback fucntion

Posted by: RcBuilder  /   Category: Array / callback / class / function / JAVASCRIPT / Object / OOP   /   No Comments
26
Jan
2016

javascript callback fucntion function foreach(arr, callback) { for (var i = 0; i < arr.length; i++) callback.call(this, arr); } var arr = ; foreach(arr, function (item) { console.log(item); }); --- function fun1(callback) { setTimeout(callback, 2000); } console.log('hey there ... '); fun1(function () { console.log('hello from callback'); }); console.log('hello again ... '); /* hey there ... hello again ... hello from callback */ --- function fun2(callback) { var user = { id: 25, Name: 'Roby Cohen', Age:.

Read more

javascript foreach implementation

Posted by: RcBuilder  /   Category: Array / callback / JAVASCRIPT   /   No Comments
09
Nov
2014

javascript foreach implementation function forEach(list,callback) { for (var n = 0; n < list.length; n++) { callback.call(list); } } var myArray = ; forEach( myArray, function(){ alert(this); // do.

Read more
  • פיתוח מערכות
  • פתרונות טכנולוגים
  • קידום אתרים
  • בניית אתרים