'How to return a selected element from an array using map ()?

I have a problem with mapping. I want to return an element from two arrays. Both arrays have a similar structure ['0', {args: (3) ......}] I would like to return the "args" element from both. "bscArray" has args [2] the same as polygonArray args [0]. So I would like to map them to new arrays first and then merge them into one. Unfortunately, the terminal still returns "undefined" to me, and in the debugger they are not even visible. How to fix it?

 let jsonValueBsc = JSON.parse(fs.readFileSync('eventsBsc.json'));

    let jsonValuePolygon = JSON.parse(fs.readFileSync('eventsPolygon.json'));

    

    var bscArray = [];


    for(var i in jsonValueBsc)
    bscArray.push([i, jsonValueBsc [i]]);

    console.log(bscArray);

    var polygonArray = [];

    for(var i in jsonValuePolygon)
    polygonArray.push([i, jsonValuePolygon [i]]);

    console.log(polygonArray);


    bscArray.map(x => console.log(x.args))

    polygonArray.map(y => console.log(y.args))
'''
All is into async function


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source