3 ms·
http://clojurescriptkoans.com/#higher-order-functions/10 http://clojurescriptkoans.com/#higher-order-functions/10 got me good. Why is it one needs to use `(coun
by blossoms 13y ago
http://clojurescriptkoans.com/#higher-order-functions/10 http://clojurescriptkoans.com/#higher-order-functions/10 got me good. Why is it one needs to use `(count a) (count b)` instead of just `a b` like worked when comparing string lengths in a previous ClojureScript Koan?
- jamii 13y agoThe `<` function only works on numbers but, unlike java, it will correctly coerce numbers with different representations. (< 1 ;; Long 1.5 ;; Double 2N ;; BigInt ) If you want java-style comparisons use `compare` instead. EDIT: Ooops, this is cljs, not clojure. The correct answer is that string comparison is lexicographic in js: "is" < "length" < "word"