There is a class
class Data { constructor(arg0, arg1) { this.arg0 = arg0; this.arg1 = arg1; } } How to represent an instance of this class new Data('arg0', 1) , in the form {arg0: 'arg0', arg1: 1} ?
There is a class
class Data { constructor(arg0, arg1) { this.arg0 = arg0; this.arg1 = arg1; } } How to represent an instance of this class new Data('arg0', 1) , in the form {arg0: 'arg0', arg1: 1} ?
Source: https://ru.stackoverflow.com/questions/744682/
All Articles
JSON.stringify(new Data('arg0', 1));- Igorconst data = new Data('arg0', 1);was the same asconst data = {arg0: 'arg0', arg1: 1);- i am so lame