[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Collection.includes query



includes is based on identity, not equality.

If you wrote this, you'd get false also.

ServerOptions.devices.detect { |d| d === "JackRouter" }.notNil

Try the includesEqual method instead.
hjh


On May 2, 2009, at 10:49 AM, Anton Hörnquist wrote:

I dont understand this:

ServerOptions.devices
-> [ Built-in Microphone, Built-in Input, Built-in Output, JackRouter ]

ServerOptions.devices.detect { |d| d == "JackRouter" }.notNil
-> true

ServerOptions.devices.includes("JackRouter")
-> false

How come includes in the last interpretation return false?


: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman