Remember that new first creates a new object before assigning it to this (and then calling your constructor function). If you don’t use new, a new object will never be created.
That means any references to this in your constructor won’t refer to a new album object, but rat...
- 12. Advanced Object Construction: Creating objects
- Publisher: O'Reilly Media, Inc.
- Released: March 2014
What happens if you leaves out the keyword "new" in a constructor's invocation? What happens if you leaves out the keyword "this" in a constructor's definition?