mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-24 06:14:01 +08:00
8 lines
488 B
TypeScript
8 lines
488 B
TypeScript
// @dynamic
|
|
// Number.parseFloat / Number.parseInt ARE the global parsers (the spec
|
|
// aliases them) — the same island lowering, byte-compared against Node.
|
|
console.log(Number.parseFloat("3.14"), Number.parseFloat("2e3"), Number.parseFloat(" -7.5abc"));
|
|
console.log(Number.parseFloat("x"), Number.parseFloat("Infinity"));
|
|
console.log(Number.parseInt("42", 10), Number.parseInt("ff", 16), Number.parseInt("0x1f", 16));
|
|
console.log(Number.parseInt("x", 10), Number.parseInt("-101", 2));
|