1
votes

I want to parse this JSON array and print the salary so this what I have tried so far there is nothing logged in the Console

if (data.action == 'SendArray') {
            let invites = data.invites
            const obj = JSON.parse(invites)
            const myJSON = JSON.stringify(obj);

            console.log(myJSON.salary)
        }

JSON [data.invites 2 line]

{"factioname":"sp-force","inviter":"MohammedZr","salary":5000},{"factioname":"air-force", "inviter":"Admin","salary":8000}

What are you trying to achieve? What is JSON Array? Which salary? What is 2 line? - newbie