Axel Rauschmayer on Nostr: #JavaScript: // Iterating over an object for (const [key, value] of ...
#JavaScript:
// Iterating over an object
for (const [key, value] of Object.entries(obj)) {
// ···
}
Details: https://exploringjs.com/impatient-js/ch_objects.html#Object.entries
// Iterating over an Array
for (const [index, value] of arr.entries()) {
// ···
}
Details: https://exploringjs.com/impatient-js/ch_arrays.html#for-of-iterating-over-index-element-pairs
// Iterating over an object
for (const [key, value] of Object.entries(obj)) {
// ···
}
Details: https://exploringjs.com/impatient-js/ch_objects.html#Object.entries
// Iterating over an Array
for (const [index, value] of arr.entries()) {
// ···
}
Details: https://exploringjs.com/impatient-js/ch_arrays.html#for-of-iterating-over-index-element-pairs