Why does the first console display the value after operating map?

let dataSource=[
      {
        id: "0",
        userName: "Jack",
        sex: "1",
        state: "1",
        interest: "1",
        birthday: "2018-1-1",
        address: "",
        time:"19:35",
      },
      {
        id: "1",
        userName: "daoma",
        sex: "1",
        state: "1",
        interest: "1",
        birthday: "2018-1-1",
        address: "",
        time:"19:35",
      },
      {
        id: "2",
        userName: "wawa",
        sex: "1",
        state: "1",
        interest: "1",
        birthday: "2018-1-1",
        address: "",
        time:"19:35",
      },
    ]
    console.log("1",dataSource)
    dataSource.map((item,index)=>{
      item.key = index
    })
    console.log("2",dataSource)

result:

Apr.24,2021

because when you click on the developer tool object model, the developer tool dynamically updates the value at this time! See that small I sign, mouse up to see its prompt text.

clipboard.png

you can write the first console as console.log ('1recording console.log DataSource [0] .key); , you'll see right away: the output is undefined, as we expected.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37b9c-2c0ad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37b9c-2c0ad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?