Function, to Test whether the Element is present in the Array
const list = [{"id":1, "data":"a"},{"id":2, "data":"b"},{"id":3, "data":"c"}]elementInArray("b", list, "data") // => trueelementInArray(5, list, "data") // => falseelementInArray("b", list, "property_not_in_data") // => false
const list = [{"id":1, "data":["a"]},{"id":2, "data":["b"]},{"id":3, "data":["c"]}]elementInArray("b", list, "data/0") // => trueelementInArray("d", list, "data/0") // => falseelementInArray("b", list, "data") // => false <- Path doesnt contain 'b'elementInArray("b", list, "data/1") // => false <- Path wrong, no elements there
The Object to Test
The array to consider
The path, under which the element will be found
Generated using TypeDoc
Function, to Test whether the Element is present in the Array
Example 1:
Example 2: