-- thisArg = 콜백의 this. 비교할 값을 this 로 받는 함수 하나를 재사용
filterWith :: (b -> a -> Bool) -> b -> [a] -> [a]
filterWith pred this = filter (pred this) -- arr.filter(callback, thisArg)
isId :: Int -> Item -> Bool
isId this item = itemId item == this -- function isId(item) { return item.id === this }
filterWith isId 3 items
-- 화살표 함수는 자기 this 가 없어 thisArg 무시 · 화살표보다 느릴 수 있다