My json array is:
[{"id":"7","name":"hello"},{"id":"7","name":"shan"},{"id":"7","name":"john"}
{"id":"7","name":"hello"}]
I want to get a new array that matches the regular expression on name, starting with a letter.
I am using regexp , but I do not know how to implement it.
Here is my code:
var newitem=_.filter(result,item=>item.name='hello');
console.log(newitem);
But he only comes back with a strict match name.
Please help me modify the above so that the result is a new array as described.
Expected Result
when a custom type letter honly shows a string
{"id":"7","name":"hello"}
source
share