Hacker News new | ask | show | jobs
by pkstn 3935 days ago
Actually only 52 :D

But yeah, I agree about googling part: I remember having Googled "tilde javascript" and "pipe javascript".. :)

Tilde is useful with indexOf:

if (~array.indexOf(item)) {}

..equals to:

if (array.indexOf(item) > -1) {}

1 comments

This is the sort of thing that makes Perl readable in comparison to Javascript :)