あのぞんブログ

JS でよく使われている Math関数やObject関数ランキング出してみた

2023-06-10

Math.sign を知ったことがきっかけで、他に知らない組み込み関数がないか調べることにしました。

順番に読んでいくのは退屈そうだったので、使用頻度の低い順で読むことにしました。以下はそのために作ったデータです。

調査方法

GitHub のソースコード検索 API を使いました。 languageJavaScriptTypeScript のコードで絞り込んでいます。

コード:

Math 関数とフィールドの使用頻度

how used math func js how used math func js

math dumped at 2023/6/10

codecount
Math.floor681728
Math.max539392
Math.round419584
Math.min405888
Math.random278016
Math.abs268672
Math.ceil246272
Math.sqrt201968
Math.PI196008
Math.pow161472
Math.cos116768
Math.sin95544
Math.log55968
Math.atan50716
Math.E42464
Math.atan232608
Math.tan19712
Math.exp17624
Math.sign11368
Math.acos10836
Math.asin10280
Math.trunc10040
Math.log107472
Math.log27432
Math.LN26488
Math.hypot5288
Math.LN103824
Math.imul3664
Math.fround2882
Math.sinh2788
Math.cbrt2543
Math.cosh2328
Math.tanh2160
Math.clz322136
Math.log1p2098
Math.LOG2E2044
Math.SQRT22026
Math.asinh2023
Math.LOG10E1950
Math.expm11941
Math.atanh1817
Math.SQRT1_21784
Math.acosh1753

Object 関数とフィールドの使用頻度

how used obj func js how used obj func js

dumped at 2023/5/22

codecount
Object.keys802816
Object.assign546816
Object.defineProperty289024
Object.is278528
Object.entries217088
Object.values204288
Object.create181760
Object.prototype176640
Object.name84480
Object.freeze83456
Object.getPrototypeOf52224
Object.defineProperties42112
Object.setPrototypeOf40704
Object.getOwnPropertyNames36608
Object.fromEntries31104
Object.hasOwn23520
Object.length16672
Object.getOwnPropertyDescriptor16400
Object.getOwnPropertySymbols15552
Object.seal13280
Object.isFrozen8560
Object.getOwnPropertyDescriptors7904
Object.isExtensible6720
Object.preventExtensions6208
Object.isSealed4136

Number fields

dumped at 2023/6/10

codecount
Number.isInteger41360
Number.MAX_VALUE31104
Number.isNaN25744
Number.MAXSAFEINTEGER23840
Number.parseInt19600
Number.POSITIVE_INFINITY14432
Number.isFinite13384
Number.prototype10736
Number.length9408
Number.NEGATIVE_INFINITY8936
Number.parseFloat6304
Number.MINSAFEINTEGER6096
Number.MIN_VALUE5880
Number.NaN5116
Number.EPSILON4684
Number.isSafeInteger3552
Number.name1232

String fields

dumped at 2023/6/10

codecount
String.fromCharCode133216
String.length75840
String.prototype56872
String.fromCodePoint6024
String.raw5216
String.name1722

© 2026 あのぞんびより