Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

es.object.from-entries.js 482B

12345678910111213141516
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var iterate = require('../internals/iterate');
  4. var createProperty = require('../internals/create-property');
  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. });