ECMAScript仕様輪読会 #88
前回: ECMAScript仕様輪読会 #87
Cosenseの招待リンク: https://scrapbox.io/projects/esspec/invitations/85b96c9fa718ce5185e307196ed8fb53
connpass: https://esspec.connpass.com/
Discord: https://discord.gg/59S3y6weQj
ES Spec Draft: https://tc39.es/ecma262/
multipage: https://tc39.es/ecma262/multipage/
資料: https://speakerdeck.com/syumai/ecmascriptshi-yang-wodu-munonibi-yao-nazhi-shi-daiziesutoban
読み物リスト
Twitter hashtag: #esspec
便利ツール
esspec-memo: https://tars0x9752.github.io/esspec-memo/esspec.html
Scrapbox Codeblock Generator: https://vzvu3k6k.github.io/scrapbox-codeblock/
TC39 Terminology: https://github.com/tc39/how-we-work/blob/main/terminology.md
esmeta playground: https://es-meta.github.io/playground/
時事ネタ
TSKaigi Hokuriku
当選発表ありました
https://tskaigi.hatenablog.com/entry/2025/10/14/140147
自己紹介 (近況報告)
syumai syumai.icon
Twitter: https://twitter.com/__syumai GitHub: https://github.com/syumai
Go / TSを書いて暮らしてます
フロントエンドカンファレンス東京がありました
今週はHono Conferenceがあります
http://honoconf.dev/
Deep Trackという方の司会予定
オンラインもあります
先々週は万博行ってました
iwatsurut
とくに、イベントもなく過ごしています。
igrep(山本悠滋)
https://github.com/igrep/
新宿御苑.wasm https://shinjukugyoen.connpass.com/event/371150/ でLTします
前回のあらすじ
https://g.co/gemini/share/340c9b51c8d4
20:39 再開
今回のメモ
code:js
const num = 12.34;
console.log("original", num);
console.log("undefined", num.toPrecision());
console.log(1, num.toPrecision(1));
console.log(2, num.toPrecision(2));
console.log(3, num.toPrecision(3));
/*
original 12.34
undefined 12.34
1 1e+1
2 12
3 12.3
*/
code:js
const num = Infinity;
undefined
num.toPrecision(10)
'Infinity'
https://www.compart.com/en/unicode/U+002E
. これはFULL STOPと呼ぶらしい
code:js
// MAX_SAFE_INTEGERを超えた整数は、結局Mathematical Valueに変換するところで値が失われているので、結局変わらない
BigInt(Number.MAX_SAFE_INTEGER + 1000000000000001)
10007199254740992n
BigInt(Number.MAX_SAFE_INTEGER + 1000000000000002)
10007199254740992n
BigInt(Number.MAX_SAFE_INTEGER + 1000000000000003)
10007199254740994n
BigInt(Number.MAX_SAFE_INTEGER) + BigInt(1000000000000003)
10007199254740994n
BigInt(Number.MAX_SAFE_INTEGER) + BigInt(1000000000000002)
10007199254740993n
BigInt(Number.MAX_SAFE_INTEGER) + BigInt(1000000000000001)
10007199254740992n
BigInt(Number.MAX_SAFE_INTEGER) + BigInt(1000000000000000)
10007199254740991n
code:js
BigInt.asIntN(4, 16n)
0n
BigInt.asIntN(4, 15n)
-1n
BigInt.asIntN(4, 14n)
-2n
BigInt.asIntN(4, 17n)
1n
BigInt.asIntN(4, 18n)
2n
BigInt.asIntN(4, 0n)
0n
BigInt.asIntN(4, 1n)
1n
BigInt.asIntN(4, 8n)
-8n
BigInt.asIntN(4, 9n)
-7n
BigInt.asIntN(4, 7n)
7n
BigInt.asIntN(5, 32n)
0n
BigInt.asIntN(5, 16n)
-16n
BigInt.asIntN(5, 17n)
-15n
BigInt.asIntN(5, 15n)
15n
code:js
BigInt.asUintN(4, 16n)
0n
BigInt.asUintN(4, 15n)
15n
BigInt.asUintN(4, 8n)
8n
BigInt.asUintN(4, 9n)
9n
BigInt.asUintN(4, 7n)
7n
code:js
Object.prototype.toString.apply(1)
'object Number'
Object.prototype.toString.apply(1n)
'object BigInt'
BigInt.prototypeSymbol.toStringTag
'BigInt'
BigInt.prototypeSymbol.toStringTag = "MyBigInt"
'MyBigInt'
BigInt.prototypeSymbol.toStringTag
'BigInt'
Object.defineProperty(BigInt.prototype, Symbol.toStringTag, { value: "MyBigInt" })
Object MyBigInt {}
Object.prototype.toString.apply(1n)
'object MyBigInt'