Closed Bug 1365288 Opened 7 years ago Closed 4 years ago

Map.get/set documentation is lacking information

Categories

(Developer Documentation Graveyard :: JavaScript, defect, P5)

All
Other
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: paul.yeboah, Unassigned)

References

()

Details

:: Developer Documentation Request

      Request Type: Correction
     Gecko Version: Trunk
 Technical Contact: 

:: Details

This is an issue with the documentation. The get/set functionality is lacking a description of whether the get/set is working by value or by reference. This has caused a very difficult bug to find in my code. I made the assumption that the "get" was working by returning a reference to the original value rather that returning a copy. I have a situation where I have a Map of a string to an array. I am performing a look up by the string key, to get the array that it stores. After mutating it I was expecting that mutated state to be persistent, but found that it wasn't. Once I re-inserted the mutated array back into the map at the same key, my code started to work as expected. Please can you make it clear in the documentation (for all methods) whether the operation is by reference or by value. The documented example is working with a primitive type so the issue wouldn't arise, like it does with a compound/object type.
Thanks.
Summary: Map.get/set documentation is lacking formation → Map.get/set documentation is lacking information
Get support and directly
MDN Web Docs' bug reporting has now moved to GitHub. From now on, please file content bugs at https://github.com/mdn/sprints/issues/ and platform bugs at https://github.com/mdn/kuma/issues/.
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.