5 ms·
the fact that you can just redefine Map in a script is mind boggling
by skrtskrt 7mo ago
the fact that you can just redefine Map in a script is mind boggling
- xigoi 7mo agoWhy? Being able to redefine anything is table stakes in dynamic languages.
- g947o 7mo agoSo? Does being able to do something means you should?
- xigoi 7mo agoI didn’t say you should. The comment I’m replying to expressed surprise that redefining something is even possible.
- fragmede 7mo agoYou can't assign a value to false, for example, so "anything" isn't everything (Node v22.17.0). > false = 4 false = 4 ^^^^^ Uncaught SyntaxError: Invalid left-hand side in assignment Fascinatingly enough though, you can assign a value to NaN. It doesn't stick tho. > NaN NaN > NaN = 42 42 > NaN NaN > (map behaves as described.)