.
This commit is contained in:
13
out.js
13
out.js
@@ -768,6 +768,18 @@ load = function load() {
|
||||
},
|
||||
configurable: true
|
||||
},
|
||||
prod: {
|
||||
value: function(val = 1) {
|
||||
return this.reduce((a, b) => a * b, val)
|
||||
},
|
||||
configurable: true
|
||||
},
|
||||
cartProduct: {
|
||||
value: function(that) {
|
||||
return this.flatMap((e) => that.map((f) => [e, f]))
|
||||
},
|
||||
configurable: true
|
||||
},
|
||||
flatDeep: {
|
||||
value: function() {
|
||||
return this.flat(Infinity)
|
||||
@@ -1029,6 +1041,7 @@ load = function load() {
|
||||
|
||||
load()
|
||||
utils = {
|
||||
log: (e, copy = false) => (console.log(copy ? e.copyDeep() : e), e),
|
||||
fetch: (url) => fetch(url).then(e => e.text()),
|
||||
fetchEval: (url) => utils.fetch(url).then(e => eval(e)),
|
||||
signAgnosticInclusiveRange: (a, b, s = Math.sign(a - b)) => Array((a - b) * s + 1).fill().map((_, i) => a - i * s),
|
||||
|
||||
Reference in New Issue
Block a user