Spread Operator for Classes
JS
S
JavaScriptSimple usage of spread
1class xpto {
2 constructor(...args) {
3 Object.assign(this, args);
4 }
5}
6
7var x = new xpto(1,2,3);Created on 1/18/2019
Simple usage of spread
1class xpto {
2 constructor(...args) {
3 Object.assign(this, args);
4 }
5}
6
7var x = new xpto(1,2,3);Created on 1/18/2019