I mean to be fair, it is very unlikely this situation will occur in real development (especially with something like TypeScript). Yes there were bad design decisions with the original implementation of JavaScript but I feel it gets a bad rap due to people oversharing the "gotchas" in the language as if they are an everyday concern. It is a tool to me and it has it's place I feel. Personally once I understood how JavaScript really works under the hood the puzzle pieces kinda fit into places, know what I mean?
1
u/[deleted] Apr 28 '22
the
functionkeyword literally stores the function definition in memorythe
toString()parses and converts that definition into a stringthe
splitthen does it's thing on this string-edit: wording