我最近一直在跟随编码教程,对JS的基础知识有了不错的掌握(当然还有很多需要学习的地方)。在我跟随的几乎每个教程中,代码都包含这段或类似的内容。
initialize: function() {
var self = this;
this.store = new MemoryStore(function() {
self.renderHomeView();
});
具体来说,
initialize: function() {
// code in here
}
我真的不知道这是什么。当然,我可以完成教程,但我想要理解我所编写的内容,而不只是复制别人写的。
我尝试使用谷歌了解更多信息,但我实在不知道该使用什么搜索词。
这是声明函数的一种方式吗? 就像这样:
functionName: function(){
// code here
}
// vs
function functionName(){
// code here
}
我有什么遗漏吗?能否有人给我发送一个相关资源的链接?
Thanks, Jay