Learning Javascript : Object Creation Patterns