Skip to content

Commit 0b3e4cd

Browse files
update discussion example
1 parent b16a907 commit 0b3e4cd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: chapters/arrays/where-for-arrays-of-objects.md

+4
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ Array::where = (query, matcher = (a,b) -> a is b) ->
6868
match += 1 if matcher(item[key], val)
6969
if match is hit then true else false
7070

71+
cats.where name:"bubbles"
72+
# => []
73+
# it's case sensitive
74+
7175
cats.where name:"bubbles", (a, b) -> "#{ a }".toLowerCase() is "#{ b }".toLowerCase()
7276
# => [ { name: 'Bubbles', favoriteFood: 'mice', age: 1 } ]
7377
# now it's case insensitive

0 commit comments

Comments
 (0)