When you are reading file data.json
from your local device and doing JSON.stringify
on the returned file.
const jsnf = JSON.stringify(fs.readFileSync("./data.json", "utf8"));
Know that it is a string
now and if you without using JSON.parse(jsnf)
start using your filter logic.
console.log(data1.filter((x) => jsnf.includes(x)));
Know that this will not work as expected.
Also until and unless we know what data is in jsnf
we cannot we sure about your logic to filter things.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…