I\'ve created a class and I would like to set some default options for values in case the user does not supply any arguments. I recently went from a constructor that took mu
Make sure you have a default for the object itself.
module.exports = class User { constructor(options) { options = options || {} this.name = options.name || "Joe"; this.age = options.age || 47; } }