Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@
| **Key Order** | Keys are unordered (in practice, insertion order is mostly preserved for string keys, but not guaranteed) | Keys are ordered by insertion; iteration follows insertion order |
| **Size Property** | No built-in way to get the number of keys; must use `Object.keys(obj).length` | Use the `.size` property for the number of entries |
| **Iterability** | Not directly iterable; must use `Object.keys`, `Object.values`, or `Object.entries` | Directly iterable with `for...of`, `.keys()`, `.values()`, `.entries()` |
| **Prototype** | Has a prototype chain; may have default properties that can collide with custom keys (can be avoided with `Object.create(null)`) | Does not have a prototype, so there are no default keys |
| **Prototype** | Has a prototype chain; may have default properties that can collide with custom keys (can be avoided with `Object.create(null)`) | Map does not traverse the prototype chain for key lookup |
| **Performance** | May be less efficient for frequent additions/removals | Optimized for frequent additions and deletions |
| **Serialization** | Can be easily serialized to JSON | Cannot be directly serialized to JSON |

Expand Down