This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
Enforce strings for index keys #4356
Closed
jpike88
started this conversation in
Suggestions
Replies: 1 comment 3 replies
-
Is there already a rule for that? What kind of bugs can this rule prevent? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Index types should be locked to strings because of the unpredictable behaviors associated with using numbers as keys on an object.
If someone wants to use numbers in that way they should use the Map object which is designed for that.
Take this example showing how a problem can arise:
Beta Was this translation helpful? Give feedback.
All reactions