-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Record.keys/entries/values #338
Comments
Earlier discussion here: #133 Closed as "not part of V1". |
#133 is talking about a different feature than what I am discussing here; see my second paragraph. I would find it pretty strange to pass a Record to a method on the Object constructor, but I guess it's better than such a facility not existing at all. (I also find it very strange to pass a string to the Object constructor; I've never done that and would look askance at any code which did.) |
I agree, I only meant to demonstrate that |
I do think it’d be perfectly fine to add keys/values/entries/fromEntries to Record, fwiw, I’m just not sure the use case is compelling enough. (also probably hasOwn for consistency even tho it can’t have any inherited properties) |
I just noticed that the
Record
constructor does not have a way of getting the keys out of a Record. In fact, as far as I can tell, there is no such facility anywhere in this proposal.An earlier version had a
Record.keys
method which was likeObject.keys
except it returned tuples. I agree that such a thing need not exist in V1 of this proposal. But I was actually expectingRecord.keys
to be likeObject.keys
except that it accepted Records. Was that discussed and rejected? If it was, is there an alternative way of getting the keys from a Record (short of a for-in loop)? It seems like there ought to be such a thing, and it seems like the obvious place to put it would beRecord.keys
.Ditto, of course, for
values
andentries
.The text was updated successfully, but these errors were encountered: