←back to thread

Four Years of Jai (2024)

(smarimccarthy.is)
166 points xixixao | 2 comments | | HN request time: 0.53s | source
Show context
spacechild1 ◴[] No.43730030[source]
> because most Javascript programmers are entirely unaware of the memory allocation cost associated with each call to anonymous functions

How does calling an anonymous function in JS cause memory allocations?

replies(2): >>43730166 #>>43731652 #
1. steveklabnik ◴[] No.43730166[source]
I also found this comment a bit strange. I'm not aware of a situation where this occurs, though he might be conflating creating an anonymous function with calling it.
replies(1): >>43731184 #
2. spacechild1 ◴[] No.43731184[source]
> he might be conflating creating an anonymous function with calling it.

Yeah, that's what I figured. I don't know JS internals all too well, so I thought he might be hinting at some unexpected JS runtime quirk.