Post History
JavaScript (Node.js), 38 32 bytes -6 bytes thanks to Shaggy! a=>a.map(v=>d[v]=-~d[v],d={})&&d Try it online! Basically just this but returning the result
Answer
#2: Post edited
# [JavaScript (Node.js)], 38 bytes- ```javascript
(a,d={})=>(a.map(v=>d[v]=1+d[v]||1),d)- ```
- [Try it online!][TIO-l4rxaxov]
- Basically just [this](https://codegolf.codidact.com/posts/281368/282836#answer-282836) but returning the result
- [JavaScript (Node.js)]: https://nodejs.org
[TIO-l4rxaxov]: https://tio.run/##RY3BCoMwEETP5iv2mNCtNG21B4k/IjkEY0qLGjHBi/rtaUwphWFneAw7b7Uo186vyZ9Hq7tgRKAKtVh3Jmqq8kFNdBG1bhYp@OmwbeMMNQutHZ0H3znvQEBDsoYjRF0RbggFQhklMfJ0eAKPX6VMirmI5XtMF0lkRYixM9D/a7DmO8FgJdnBbd/lvX3SgyKY5IxVZA8f "JavaScript (Node.js) – Try It Online"
- # [JavaScript (Node.js)], ~~38~~ 32 bytes
- *-6 bytes thanks to Shaggy!*
- ```javascript
- a=>a.map(v=>d[v]=-~d[v],d={})&&d
- ```
- [Try it online!][TIO-l4rxaxov]
- Basically just [this](https://codegolf.codidact.com/posts/281368/282836#answer-282836) but returning the result
- [JavaScript (Node.js)]: https://nodejs.org
- [TIO-l4rxaxov]: https://tio.run/##RY3BCoMwEETP5iv2JAmsUttqDxJ/RHIIxpQWa8QEL2J/PU1SSmHYGR7DzlNu0g7rY3HFbNToNfeSd7J8yYVuvFP9JnjxjoaK7wfLc@UHM1sHbrTOAoeeZH2FEHRGuCDUCE2QwMDTqRK4/SpNUsh1KF9DOgkiWkK0WYH@X4PR3wkGO8kiN9NYTuZOI0XQyRlryeE/ "JavaScript (Node.js) – Try It Online"
#1: Initial revision
# [JavaScript (Node.js)], 38 bytes ```javascript (a,d={})=>(a.map(v=>d[v]=1+d[v]||1),d) ``` [Try it online!][TIO-l4rxaxov] Basically just [this](https://codegolf.codidact.com/posts/281368/282836#answer-282836) but returning the result [JavaScript (Node.js)]: https://nodejs.org [TIO-l4rxaxov]: https://tio.run/##RY3BCoMwEETP5iv2mNCtNG21B4k/IjkEY0qLGjHBi/rtaUwphWFneAw7b7Uo186vyZ9Hq7tgRKAKtVh3Jmqq8kFNdBG1bhYp@OmwbeMMNQutHZ0H3znvQEBDsoYjRF0RbggFQhklMfJ0eAKPX6VMirmI5XtMF0lkRYixM9D/a7DmO8FgJdnBbd/lvX3SgyKY5IxVZA8f "JavaScript (Node.js) – Try It Online"