Skip to content

Commit

Permalink
Update Issues “issue-17”
Browse files Browse the repository at this point in the history
  • Loading branch information
technetium-co committed Mar 14, 2024
1 parent b208461 commit 42ca395
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions collections/_issues/issue-17.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"codeSnippet": {
"language": "js",
"code": {
"code": "const entries = [ ['a', 1],\n ['b', 2],\n ['c', 3]\n];\n\n// ❌ Instead of doing it like this\nconst obj = entries.reduce((acc, [key, value]) => {\n acc[key] = value;\n return acc;\n}, {});\n// obj = {a: 1, b: 2, c: 3}\n\n// ✅ Use Object.fromEntries instead\nconst obj = Object.fromEntries(entries);\n// obj = {a: 1, b: 2, c: 3}"
"code": "const entries = [ ['a', 1],\n ['b', 2],\n ['c', 3]\n];\n\n// ❌ Instead of doing it like this:\nconst obj = entries.reduce((acc, [key, value]) => {\n acc[key] = value;\n return acc;\n}, {});\n// obj = {a: 1, b: 2, c: 3}\n\n// ✅ Use Object.fromEntries instead:\nconst obj = Object.fromEntries(entries);\n// obj = {a: 1, b: 2, c: 3}"
},
"showLineNumbers": false
}
Expand Down Expand Up @@ -125,4 +125,4 @@
]
}
]
}
}

0 comments on commit 42ca395

Please sign in to comment.