jashkenas/coffee-script — Issue #2107: in operator not consistent for strings
Author: kylegibson
Created: 2012-02-06 15:20:22+00:00
State: open

http://coffeescript.org/#try:z%20%3D%20[1%2C2%2C3%2C4]%0Aa%20%3D%20%27xyz%27%0Aalert%20%27x%27%20in%20a%0Aalert%201%20in%20z%0Aalert%20%27yz%27%20in%20a%0Aalert%20a.indexOf%28%27yz%27%29%20%3E%3D%200

Why does 'yz' in 'xyz' return false when 'xyz'.indexOf('yz') >= 0 ?