added default value to the object parameter
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
|
||||
class Product {
|
||||
|
||||
constructor({ id = '', name = '', desc = '', cost = 0, image = null }) {
|
||||
constructor({ id = '', name = '', desc = '', cost = 0, image = null } = {}) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.desc = desc;
|
||||
|
||||
Reference in New Issue
Block a user