`
goddy128
  • 浏览: 92237 次
  • 性别: Icon_minigender_1
  • 来自: 上海
最近访客 更多访客>>
社区版块
存档分类
最新评论

OReilly.Dojo.The.Definitive.Guide notes

阅读更多
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