Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
468 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var $ = require('../internals/export');
|
---|
| 2 | var iterate = require('../internals/iterate');
|
---|
| 3 | var createProperty = require('../internals/create-property');
|
---|
| 4 |
|
---|
| 5 | // `Object.fromEntries` method
|
---|
| 6 | // https://github.com/tc39/proposal-object-from-entries
|
---|
| 7 | $({ target: 'Object', stat: true }, {
|
---|
| 8 | fromEntries: function fromEntries(iterable) {
|
---|
| 9 | var obj = {};
|
---|
| 10 | iterate(iterable, function (k, v) {
|
---|
| 11 | createProperty(obj, k, v);
|
---|
| 12 | }, { AS_ENTRIES: true });
|
---|
| 13 | return obj;
|
---|
| 14 | }
|
---|
| 15 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.