Initializing Objects with $.extend()

If jQuery is available, $.extend() can be useful “quick and dirty” method for initializing an object with defaults, while allowing for the caller to provide values to override the defaults.

The advantage is simplicity. One disadvantage is that there is no checking of arguments. The particular situation will drive the relative importance of each.


Leave a Reply