1 Person = Backbone.Model.extend({
 2     defaults: {
 3         name: 'Fetus',
 4         age: 0,
 5         children: []
 6     },
 7     initialize: function() {
 8         console.log('欢迎来到这个无蛋的世界!');
 9     }
10 });
11 
12 var person = new Person({
13     name: 'Thomas',
14     age: 67,
15     children: ['Ryan']
16 });
17 var attributes = person.toJSON();
18 console.log(attributes);
19 console.log(JSON.stringify(attributes));

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-11
  • 2021-10-13
  • 2021-09-16
  • 2022-12-23
  • 2021-08-09
  • 2022-12-23
猜你喜欢
  • 2021-12-09
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案