Echo JS 0.11.0

<~>
kolodny 3524 days ago. link 1 point
One of the "good code" slides has this

    let startsWithVowel = word => !!~VOWELS.indexOf(word[0]);

?!

Replies

davidchase 3524 days ago. link 1 point
its the NOT bitwise operator which simple takes -(n + 1) where n is the number to the right of the operator. then !! is a way of coercing to boolean so essentially the returned value is either true or false depending if letter exists in the array instead of returning the index or -1 if it doesnt exist.
kolodny 3521 days ago. link 4 points
I know what it is and how it's being used, my issue is with this being on a slide titled "good code", the fact that you can mistake my comment as a developer not understanding what that code does further proves my point