I have an array of objects. I want to filter it to get objects in which some property contains a math string.
If my array
var data = [
{"name: "John",
"surname": "Smith"},
{"name": "Peter",
"surname: "Smithie"}]
I and the filter with the string "Media", it should return both elements. If the string is "John", only the first.
This is my code:
var filtered = R.filter(R.where({ x: R.contains("Smi")}))(data);
I get an error message:
Cannot read property 'indexOf' of undefined
Can someone help me with my Ramda function? It must be something small, I’m probably missing out. thanks in advance
Mojqi source
share