main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
510 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var $ = require('../internals/export');
|
---|
3 | var aMap = require('../internals/a-map');
|
---|
4 | var iterate = require('../internals/map-iterate');
|
---|
5 |
|
---|
6 | // `Map.prototype.keyOf` method
|
---|
7 | // https://github.com/tc39/proposal-collection-methods
|
---|
8 | $({ target: 'Map', proto: true, real: true, forced: true }, {
|
---|
9 | keyOf: function keyOf(searchElement) {
|
---|
10 | var result = iterate(aMap(this), function (value, key) {
|
---|
11 | if (value === searchElement) return { key: key };
|
---|
12 | }, true);
|
---|
13 | return result && result.key;
|
---|
14 | }
|
---|
15 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.