fasttime / JScrewIt

Write any JavaScript with six characters: ! ( ) + [ ]
https://jscrew.it
ISC License
161 stars 13 forks source link

some question about "fromCharCo" #37

Open Clayblockunova opened 1 year ago

Clayblockunova commented 1 year ago

Currently, "fromCharCo" is defined as "from3har3o".split(3).join("C"). but I tried "from0har0o".split(0).join("C"), i's shorter and works will in Chromium. What did you think at that time?

fasttime commented 1 year ago

That's because of the toString optimization which makes "from3har3o" shorter than "from0har0o" when encoded as (420302320151902).toString(31). Chromium browsers don't use that definition for "fromCharCo", they use the default encoding.