I started by looking at the application localtodosand see that this code makes it a function. I do not know how to make this choice. My assumption is that the code in the function is not executed until you call a function other than the object literal and which will be interpreted immediately.
Here is a usage example:
var FavoritesRow = Backbone.Model.extend({
Name: 'FavoritesRow',
defaults: function () {
return {
url: "http://www.google.com",
title: "google",
favicon: "http://www.google.com/favicon.ico",
tag: "search"
};
}
});
But which rule / rules should be followed in general?
user3293653
source
share