Skip to content
Advertisement

Flip associative array and store new values in subarrays to prevent losing duplicated values

I have a flat associative array which may contain duplicate values.

JavaScript

I need to restructure the data to store the original values as new keys and the original keys pushed into subarrays associated with the new keys.

JavaScript

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement