News for hackers. Stuff that matters.
Re:How to write X in both Python 3 and JavaScript by andyfleming on Friday September 14, 2018 @12:44PM (#17988731)
Instead of...

    Object.entries(newDict).forEach(element => {
      console.log(`${element[0]} ${element[1]}`)
    })
... you could write ...

    for (const key in newDict) {
      console.log(`${key} ${newDict[key]}`)
    }
... or ...

    for (const [key, value] of Object.entries(newDict)) {
      console.log(`${key} ${value}`)
    }

There are no comments on this comment yet.