Twitter hashtag: #esspec
便利ツール
時事ネタ
自己紹介 (近況報告)
syumai syumai.icon
Go / TSを書いて暮らしてます
MCPを触ってます
iwatsurut
とくに、イベントもなく過ごしています。
igrep(山本悠滋)
今月は見たい勉強会が多すぎる、と思ったけど多いのは勉強会だけじゃなかった。引っ越しの用事もあって忙しい
mae616(まえ)
技術書典でJavaScriptとWebブラウザの仕組みの技術同人誌を出すので、一人ではなかなか読めないので参加させていただきました。よろしくお願いします。
英語は雰囲気というか真面目に全くダメです。翻訳頼りです。かなり読むのは苦手意識があります。頑張ります。
20:45 再開
前回のあらすじ
今回の範囲
In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, decodeURI() can determine how many more escape sequences to consume. If decodeURI() fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a URIError is thrown.
esmeta
kiesel
encodeURI
code:js
const a = '👨👨👦';
console.log(a);
console.log(encodeURI(a));
const b = '\ud842';
console.log(b);
console.log(encodeURI(b));
---
👨👨👦
%F0%9F%91%A8%E2%80%8D%F0%9F%91%A8%E2%80%8D%F0%9F%91%A6
�
file:///Users/syumai/go/src/github.com/syumai/til/js/esspec77/a.mjs:7
console.log(encodeURI(b));
^
URIError: URI malformed
at encodeURI (<anonymous>)
at file:///Users/syumai/go/src/github.com/syumai/til/js/esspec77/a.mjs:7:13
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)
Constructor Properties of the Global Object
code:js
String(1)
'1'
new String(1)
BigInt(1)
1n
new BigInt(1)
Uncaught TypeError: BigInt is not a constructor
at new BigInt (<anonymous>)