?
u
/
p
1-9
When the filter
method is called, the following steps are taken:
When the map
method is called, the following steps are taken:
When the find
method is called, the following steps are taken:
When the some
method is called, the following steps are taken:
When the every
method is called, the following steps are taken:
empty
, thenWhen the reduce
method is called, the following steps are taken:
empty
, thenWhen the join
method is called, the following steps are taken:
","
.When the addAll
method is called, the following steps are taken:
The length
property of the addAll
method is
When the deleteAll
method is called, the following steps are taken:
allDeleted
to be allDeleted
&& wasDeleted
allDeleted
);
function mapValues(callbackFn, thisArg) {
assert(isObject(this), 'this is not an object');
assert(isCallable(callbackFn), 'callback is not a function');
const Ctor = SpeciesConstructor(this, Map);
const retObj = new Ctor();
const _set = retObj.set;
for(const [key, value] of this) {
const newValue = Reflect.apply(callbackFn, thisArg, [value, key, this])
Reflect.apply(_set, retObj, [key, newValue]);
}
return retObj;
}
function mapKeys(callbackFn, thisArg) {
assert(isObject(this), 'this is not an object');
assert(isCallable(callbackFn), 'callback is not a function');
const Ctor = SpeciesConstructor(this, Map);
const retObj = new Ctor();
const _set = retObj.set;
for(const [key, value] of this) {
const newKey = Reflect.apply(callbackFn, thisArg, [value, key, this])
Reflect.apply(_set, retObj, [newKey, value]);
}
return retObj;
}
When the find
method is called, the following steps are taken:
When the findKey
method is called, the following steps are taken:
When the keyOf
method is called, the following steps are taken:
When the some
method is called, the following steps are taken:
When the every
method is called, the following steps are taken:
When the includes
method is called, the following steps are taken:
When the reduce
method is called, the following steps are taken:
function merge(...iterables) {
assert(isObject(this), 'this is not an object');
assert(this instanceof Map, 'this is not a Map instance');
for(const iterable of iterables) {
for(const [key, value] of iterable) {
this.set(key, value);
}
}
return this;
}
When the deleteAll
method is called, the following steps are taken:
The length
property of the deleteAll
method is
function update(key, cb, thunk) {
assert(isObject(this), 'this is not an object');
assert(isCallable(callbackFn), 'callback is not a function');
asset(isMap(this), 'this is not a Map instance');
const isPresentInMap = this.has(key);
if (isPresentInMap === false && arguments.length < 3) {
throw new Error('Invalid!');
}
const value = isPresentInMap ? this.get(key) : thunk(key, this);
const newValue = cb(value, key, this);
this.set(key, newValue);
return this;
}
When the keyBy
method is called, the following steps are taken:
When the addAll
method is called, the following steps are taken:
The length
property of the addAll
method is
When the deleteAll
method is called, the following steps are taken:
The length
property of the deleteAll
method is
When the deleteAll
method is called, the following steps are taken:
The length
property of the deleteAll
method is
© 2024 Michał Wadas, Ecma International
All Software contained in this document ("Software") is protected by copyright and is being made available under the "BSD License", included below. This Software may be subject to third party rights (rights from parties other than Ecma International), including patent rights, and no licenses under such third party rights are granted under this license even if the third party concerned is a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS AVAILABLE AT https://ecma-international.org/memento/codeofconduct.htm FOR INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO IMPLEMENT ECMA INTERNATIONAL STANDARDS.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.