НС
Size: a a a
НС
DE
AA
AA
DE
НС
НС
НС
T
const newArr = [...arr];
[newArr[1], newArr[3]] = [newArr[3], newArr[1]];
НС
НС
const newArr = [...arr];
[newArr[1], newArr[3]] = [newArr[3], newArr[1]];
НС
T
DE
javascript
const Collection = (() => {
function Collection () {
let collection = Object.create(Array.prototype)
collection = (Array.apply(collection, arguments) || collection)
Collection.injectClassMethods(collection)
return (collection)
}
Collection.injectClassMethods = collection => {
let method
for (method in Collection.prototype) {
if (Collection.prototype.hasOwnProperty(method)) {
collection[method] = Collection.prototype[method]
}
}
return (collection)
}
Collection.fromArray = array => {
let collection = Collection.apply(null, array)
return (collection)
}
Collection.isArray = value => {
let stringValue = Object.prototype.toString.call(value)
return (stringValue.toLowerCase() === '[object array]')
}
return (Collection)
}).call({})
S
javascript
const Collection = (() => {
function Collection () {
let collection = Object.create(Array.prototype)
collection = (Array.apply(collection, arguments) || collection)
Collection.injectClassMethods(collection)
return (collection)
}
Collection.injectClassMethods = collection => {
let method
for (method in Collection.prototype) {
if (Collection.prototype.hasOwnProperty(method)) {
collection[method] = Collection.prototype[method]
}
}
return (collection)
}
Collection.fromArray = array => {
let collection = Collection.apply(null, array)
return (collection)
}
Collection.isArray = value => {
let stringValue = Object.prototype.toString.call(value)
return (stringValue.toLowerCase() === '[object array]')
}
return (Collection)
}).call({})

T
НС
DE