The following expression should return "1":
(.indexOf (to-array [:a :b :c]) :b)
but actually the result is -1.
Note that this method call behaves normally with other type of array:
>(.indexOf (to-array ["a" "b" "c"]) "b")
>1
So I guess there might something wrong with the type Keyword.
Anyone have a look at this?
Windows, clojurescript-2755
Array.prototype.indexOf uses strict equality (js === operator) to compare search item with array items. Keywords are Objects, and the same keyword-equal object may not be the same identical object. Non identical objects never compare strictly equal in js and there is nothing that can be done to change this.
Use something other than indexOf to find your item. You need to compare items with the cljs = function or with keyword-equal?
This is not a bug.