Solutions Log

So I only have to figure things out once.

Create a JavaScript Object With Overwrite-able Settings

1
2
3
4
5
6
7
8
9
var Fancy = {
  settings: {
      something: 'one',
      somethingElse: 'two'
  },
  init: function(options){
      var s = $.extend({}, this.settings, options);
  }
}

Call it like so:

1
Fancy.init({something: 'Luke', somethingElse: 'Wroblewski'});

That’s one way to do it anyway.

JavaScript

Comments