خرید بک لینک
class="vote">

Vote count: 0

im creating a class where i would be able to have in my constructor dynamic variables, but im not sure if im doing the right way or if it is valid.

Example static: my class:

class MyClass{
constructor(options){
    this.propertyname = options.value;
    this.propertyname = options.value;
    this.propertyname = options.value;

}
}

Does this example would be the same of the above? My only issue would be that the example i have wasnt making the options value assign to "this." my class:

class MyClass{
    constructor(options){
        for (var property in options) {
            if (options.hasOwnProperty(property)) {
                this[property] = options[property];
            }
        }

    }
}

Calling:

var example = new MyClass({
    property1:          "Something",
    property2:          "NY" ,
    });

asked 41 secs ago

برچسب: class with dynamic array c,class with dynamic properties c,matrix class with dynamic memory allocation,java class with dynamic fields,delphi class with dynamic array,class dynamics,class dynamics definition,class dynamics of agrarian change,class dynamics of agrarian change pdf,class dynamic c, نویسنده: استخدام کار تاريخ: يکشنبه 24 مرداد 1395 ساعت: 5:06

صفحه بندی