论坛首页 入门技术论坛

OReilly.Dojo.The.Definitive.Guide notes

浏览 1545 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2009-02-17   最后修改:2009-02-18
1:
bop = [4,5,6,5,6, foo]; // bop contains a nested Array
dojo.indexOf(bop, foo); //5, because (a reference to) foo is contained in bop
dojo.indexOf(bop, [1,2,3]); //-1, because foo is not the same object as [1,2,3]


2:
var a = new Array(1,2,3,...);
//A lot of extra typing for very little purpose
a.forEach(function(x) {console.log(x);}); //approach one
//A lot less typing so that you can get work done quickly
a.forEach("console.log(item)"); //approach two

论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics