خرید بک لینک

Vote count: 0

I have a simple class, and I'm trying to figure out how to set a default value in the constructor:

var Foo = function(bar = Foo.VAL1) {

    bar = {VAL1 : 1, VAL2: 2};
}

but this is apparently wrong. What's the correct way to set a default enum value, or do I need to set the default to null, and check for the null in the constructor and set accordingly?

asked 1 min ago

- - , .

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 12 اسفند 1394 ساعت: 5:51

صفحه بندی