I have a class that only takes one object in its constructor. For convenience, I would like not to manually write down, enter the object's fields by some algorithm or method. How can this be done? Here's an example:
for (let item in config) this[item] = config[item];Declan Freeman
To place the code, please use CodePen or similar tool. Thanks you!