Live data from Hacker News

Writing JavaScript with Only Six Characters

javascript.christmas

11–18 of 18 posts

Re: Writing JavaScript with Only Six Characters

#11
post #2

I don't write alot of blog posts. Appreciate any feedback you might have :)

I love it. But I think it cheats a tiny bit by getting a word that requires only characters from "false". It means you're demonstrating the same trick four times.

Maybe you could do a kind of proof:

1. This is how you get any character 2. This is how you call eval() 3. QED

Re: Writing JavaScript with Only Six Characters

#13

There's Dwitter, a minimalist JavaScript code community, where we use these kind of tricks to write interesting code, demos and concepts with just 140 characters or less: https://dwitter.net/

This is fascinating! Thanks for the share, I had no idea this even existed. Some of the posts are impressive too. Walther is known for their short reset triggers on their handguns for example.

Re: Writing JavaScript with Only Six Characters

#14

There's Dwitter, a minimalist JavaScript code community, where we use these kind of tricks to write interesting code, demos and concepts with just 140 characters or less: https://dwitter.net/

This is fascinating! Thanks for the share, I had no idea this even existed. Some of the posts are impressive too. Walther is known for their short reset triggers on their handguns for example.

[deleted]

Re: Writing JavaScript with Only Six Characters

#15

There's Dwitter, a minimalist JavaScript code community, where we use these kind of tricks to write interesting code, demos and concepts with just 140 characters or less: https://dwitter.net/

This is fascinating! Thanks for the share, I had no idea this even existed. Some of the posts are impressive too. Walther is known for their short reset triggers on their handguns for example.

[deleted]

Re: Writing JavaScript with Only Six Characters

#16

There's Dwitter, a minimalist JavaScript code community, where we use these kind of tricks to write interesting code, demos and concepts with just 140 characters or less: https://dwitter.net/

This is fascinating! Thanks for the share, I had no idea this even existed. Some of the posts are impressive too. Walther is known for their short reset triggers on their handguns for example.

I've just posted a working code on Dwitter based on this "JavaScript with Only Six Characters", it shows 1e+100 turning into Infinity. https://www.dwitter.net/d/16881

Re: Writing JavaScript with Only Six Characters

#17
post #2

I don't write alot of blog posts. Appreciate any feedback you might have :)

I love it. But I think it cheats a tiny bit by getting a word that requires only characters from "false". It means you're demonstrating the same trick four times. Maybe you could do a kind of proof: 1. This is how you get any character 2. This is how you call eval() 3. QED

Yeah the ability to get any character would really show more of how this works

Re: Writing JavaScript with Only Six Characters

#18
post #2

I don't write alot of blog posts. Appreciate any feedback you might have :)

Please run simple code to verify accuracy before publishing it.

The unary plus operator coerces undefined to NaN, not to zero as your article states.

The unary plus operator coerces NaN to NaN, not to zero as your article states. (Remember that NaN is already a number, despite its name.)

If you need to coerce any falsy value to 0, the simplest way is to use bitwise operators. If you want to do it the six character way, I guess use Math.imul

Post reply on HN