Skip to content
Advertisement

Tag: default-value

Map default value

I’m looking for something like default value for Map. Now the result is Undefined but I want to get empty array []. Answer First of all to answer the question regarding the standard Map: Javascript Map as proposed in ECMAScript 2015 does not include a setter for default values. This, however, does not restrain you from implementing the function yourself.

Advertisement