python-vs-javascript
python-vs-javascript copied to clipboard
Improve readability of JS examples
As an example, I take this one
const someDict = { one: 1, two: 2, three: 3 }
// one 1
// two 2
// three 3
Object.entries(someDict).forEach(element => {
console.log(`${element[0]} ${element[1]}`)
})
I think you may improve it by giving the meaningful names for the variables as you do in Python example
const someDict = { one: 1, two: 2, three: 3 }
// one 1
// two 2
// three 3
Object.entries(someDict).forEach(([key, value]) => {
console.log(`${key} ${value}`)
})
There are other examples that might be improved in the same way.