I am trying to get default values ββfor use as part of a method. It seems that Model.get() cannot be used in the method itself. I tried two console.log , which shows that the variable is not defined.
define(['jquery', 'Underscore', 'Backbone'], function($, _, Backbone){ var Game = Backbone.Model.extend({ //default values for the function defaults: { rows : 9, cols : 8, baseScore : 100, numBlockTypes : 6, baseLevelTimer : 60000, baseLevelScore : 1500, baseLevelExp : 1.05, }, initialize: function(){ console.log(this.get(numBlockTypes)); //console.log(numBlockTypes); } }), game = new Game; return game; });
user1187135
source share