[Solved] JavaScript: How can Get the json.file that it was post to my code?


var device_array = { device_id : [["7547092d-e03e-5148-a54f-8276a85d7f70","cpp_node_192-168-56-1:6111"]] };

var from_file_array = [
    { device_id_from_file: "7547092d-e03e-5148-a54f-8276a85d7f70" },
    { device_id_from_file: "93e71ba7-fb56-5592-a5f6-d855203dd7ae" },
    { device_id_from_file: "93e71ba7-fb56-5592-a5f6-d855203dd7ae" },
    { device_id_from_file: "fe21abdf-706f-5c7b-adb8-2507e145e820" },
];

var val = device_array['device_id'][0][0];

for (var i= 0; i < from_file_array.length; i++) {

    if(from_file_array[i].device_id_from_file === val){
        console.log("device ids are matches");
    };
};

6

solved JavaScript: How can Get the json.file that it was post to my code?