23:19
<jschoi>
If we were to guess which standard functions do developers most commonly use explicitly, among all JavaScript code, then what would those functions be? console.log? Array.prototype.push? Function.prototype.call? Array.from?
23:20
<pokute>
Array.map
23:22
<jschoi>

Indeed, when I count occurrences in Gzemnid’s dataset of top-1000 downloaded NPM packages in 2019-09, then I get the following results:

> ls
search.topcode.sh
slim.topcode.1000.txt.lz4
> ./search.topcode.sh '\b.map\b' | awk 'END { print NR }'
1016503
> ./search.topcode.sh '\.call\b' | awk 'END { print NR }'
500084
> ./search.topcode.sh '\bconsole.log\b' | awk 'END { print NR }'
271915
> ./search.topcode.sh '\.apply\b' | awk 'END { print NR }'
225315
> ./search.topcode.sh '\.bind\b' | awk 'END { print NR }'
170248
> ./search.topcode.sh '\.set\b' | awk 'END { print NR }'
168872
> ./search.topcode.sh '\.push\b' | awk 'END { print NR }'
70116
23:24
<jschoi>
Obviously though these are only rough surrogates for the actual total JavaScript codebase of humankind.
23:25
<pokute>
I don't trust minimized/transpiled code as much tho. It's no exactly what people write.
23:26
<jschoi>
As far as I can tell, Gzemnid tries to exclude minified code (https://github.com/nodejs/Gzemnid/blob/main/README.md#deception), although it has lots of other limitations…
23:27
<jschoi>
I don’t think the “slim” in the filename means minified. I think it means LZ4 compressed.
23:27
<jschoi>
There’s slim.code.coffee.txt.lz4 and slim.code.ts.txt.lz4 too.