Learning by coding, here i have an array of objects (data), and nodeId which is number , i want to check if that arrays 'target' has same value as nodeId then 'return', should i use map(), find(), filter(), how should i know which to use ? english is not my mother language so could be mistakes
data:
const Test = '7'
const nodeId = parseInt(Test);
const data = [
{ target: 4, name: "usa" },
{ target: 7, name: "England" },
{ target: 3, name: "Japan" }
];
if (check if data and nodeId both have same value then) {
return;
}