Skip to main content

Timeline for ES6 Classes Default Value

Current License: CC BY-SA 3.0

8 events
when toggle format what by license comment
Nov 12, 2015 at 12:52 comment added Mathieu Dutour Yes i guess it depends of what you are doing. There might be some options without any default.
Nov 11, 2015 at 16:49 comment added Val @mathieu shouldn't it be ... if(defaults.hasOwnProperty(key)){ this[key]=populated; } otherwise you are keeping any junk that options give, I could rewrite a class method by doing options.someMethod = null; and my guess would be that it could break the class. I hope it's not too complicated :)
Jul 10, 2015 at 14:38 comment added Qantas 94 Heavy @LeonardoAlves assuming you're using an up-to-date version of Babel, it should convert const to var correctly in the transpiled code.
Jul 10, 2015 at 14:36 history rollback Qantas 94 Heavy
Rollback to Revision 1
S Jul 10, 2015 at 14:36 history suggested Leonardo Alves CC BY-SA 3.0
Had to change const to var in the for.
Jul 10, 2015 at 14:35 review Suggested edits
S Jul 10, 2015 at 14:36
Jul 10, 2015 at 14:32 vote accept Leonardo Alves
Jul 10, 2015 at 18:12
Jul 10, 2015 at 13:47 history answered Mathieu Dutour CC BY-SA 3.0