2 ms·
A dev I worked with though it would be a good idea to use an object in javascript to solve a problem. He made the first key 0, the second key 1, and so on. Yo
by zaphod420 3y ago
A dev I worked with though it would be a good idea to use an object in javascript to solve a problem. He made the first key 0, the second key 1, and so on. You can't use a number as a key, so there was extra logic to make sure it was cast properly into a number when needed.
I asked him why he didn't just use an array and he just kind of had a mind blown look on his face.
- partitioned 3y agoHow much do you pay?
- milesvp 3y agofun fact, all arrays in php are also associative. I once worked on code that managed to delete one of the array index keys. That was fun to debug