main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 16 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
549 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict';
|
---|
| 2 | var $ = require('../internals/export');
|
---|
| 3 | var sameValueZero = require('../internals/same-value-zero');
|
---|
| 4 | var aMap = require('../internals/a-map');
|
---|
| 5 | var iterate = require('../internals/map-iterate');
|
---|
| 6 |
|
---|
| 7 | // `Map.prototype.includes` method
|
---|
| 8 | // https://github.com/tc39/proposal-collection-methods
|
---|
| 9 | $({ target: 'Map', proto: true, real: true, forced: true }, {
|
---|
| 10 | includes: function includes(searchElement) {
|
---|
| 11 | return iterate(aMap(this), function (value) {
|
---|
| 12 | if (sameValueZero(value, searchElement)) return true;
|
---|
| 13 | }, true) === true;
|
---|
| 14 | }
|
---|
| 15 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.