Skip to main content
added 251 characters in body
Source Link
Voile
  • 406
  • 2
  • 13

JavaScript (ES6) By Ephellon Dantzler

{length:1, charCodeAt:()=>(e='Hello, World!', String.fromCharCode=()=>'')}

Try it online!

That was pretty easy.

I noticed that any string inputs wouldn't be possible to output Hello, World! because the whole thing inside String.fromCharCode will only return multiples of 4, and ! has a char code of 33. So clearly we just have to hack the whole program. Hacking built-ins in JavaScript is trivial if one doesn't try to stop them (and even if one does so, there are usually lots of workarounds...).

JavaScript (ES6) By Ephellon Dantzler

{length:1, charCodeAt:()=>(e='Hello, World!', String.fromCharCode=()=>'')}

Try it online!

That was pretty easy. Hacking built-ins in JavaScript is trivial if one doesn't try to stop them (and even if one does so, there are usually lots of workarounds...)

JavaScript (ES6) By Ephellon Dantzler

{length:1, charCodeAt:()=>(e='Hello, World!', String.fromCharCode=()=>'')}

Try it online!

That was pretty easy.

I noticed that any string inputs wouldn't be possible to output Hello, World! because the whole thing inside String.fromCharCode will only return multiples of 4, and ! has a char code of 33. So clearly we just have to hack the whole program. Hacking built-ins in JavaScript is trivial if one doesn't try to stop them (and even if one does so, there are usually lots of workarounds...).

Source Link
Voile
  • 406
  • 2
  • 13

JavaScript (ES6) By Ephellon Dantzler

{length:1, charCodeAt:()=>(e='Hello, World!', String.fromCharCode=()=>'')}

Try it online!

That was pretty easy. Hacking built-ins in JavaScript is trivial if one doesn't try to stop them (and even if one does so, there are usually lots of workarounds...)