The thing that I am doing for now is not giving the correct answer.
As a result, I am getting just the value of brr array:
["model/model.yaml",
"model/storage-complextypes.yaml",
"model/storage-simpletypes.yaml"]
Trying to find out where I have made a mistake
let arr = [{
id: "862d-8f99-4638-ef1d",
data: "---↵ inventory:↵ - devices:↵ platformtypes:… extract:↵ path: create_time↵",
path: "inventory/inventory.yaml"
}, {
id: "ccad-2ea5-1241-4d1a",
data: "---↵ model:↵ services:↵ - name: nano↵ …erdelete: cascade↵ apiaccess: readonly↵↵",
path: "model/model.yaml"
}, {
id: "5f6d-2ce9-a5e4-dee8",
data: "---↵ model:↵ packages:↵ - name: storage↵ …olicy rules.↵ type: Collection(string)↵↵",
path: "model/storage-complextypes.yaml"
}]
const brr = ["model/model.yaml", "model/storage-complextypes.yaml", "model/storage-simpletypes.yaml"]
const res = brr.filter((i) => arr.filter((j) => j.path !== i))
console.log(res)
filter()returns an array which istruthyand so all elements are included in the outerfilter()..every()or.some()