added default value to the object parameter

This commit is contained in:
Mohammed Ashab Uddin
2020-07-25 10:46:30 +04:00
parent 6288eefa99
commit 90a14a9e1b

View File

@@ -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;