Skip to content

Instantly share code, notes, and snippets.

@aaronpowell
Created May 6, 2014 05:44
Show Gist options
  • Select an option

  • Save aaronpowell/b0220b8cddccf24b6d3f to your computer and use it in GitHub Desktop.

Select an option

Save aaronpowell/b0220b8cddccf24b6d3f to your computer and use it in GitHub Desktop.
sweet.js in operator to handle arrays
operator (in) 10 left { $l, $r} => #{ Array.isArray($r) ? !~$r.indexOf($l) : !!$r[$l] }
var x = 7 in [1,2,3,4];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment