View AsyncFunction.gate.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* see ... [https://stackoverflow.com/a/76575046/2627243] | |
* | |
* ... answering following SO question ... | |
* | |
* "How to prevent an async function from being invoked | |
* a 2nd time before having finished fetching the first | |
* query from a firestore database?" | |
*/ | |
(function (Object, Function, Symbol, Reflect) { |
View isDeepDataStructureEquality.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// see ... [https://stackoverflow.com/questions/71015428/how-to-get-the-intersection-of-two-sets-while-recognizing-equal-set-values-items/71016510#71016510] | |
// | |
// How to get the intersection of two sets while recognizing | |
// equal set values/items not only by reference but by their | |
// equal structures and entries too? | |
// see also ... [https://stackoverflow.com/questions/76512735/javascript-check-if-arrays-within-an-array-are-the-same] | |
// | |
// Javascript - Check if arrays within an array are the same |
View getIntersectionOfMany.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getIntersectionOfMany(...listOfIterables) { | |
function getIntersectionOfTwo(intersection, iterableItem) { | |
// ensure two arrays ... | |
const [ | |
comparisonBase, // ... the shorter one as comparison base | |
comparisonList, // ... the longer one to filter from. | |
] = [intersection, iterableItem] |
View RegExp.escape-toSearch.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The tool named `toSearch` is a helper method nailed statically | |
* onto the `RegExp` constructor/namespace. It does support a way | |
* of building search terms/strings at runtime. | |
* In order to accomplish this task `RegExp.toSearch` makes use of | |
* `RegExp.escape` that's implementation takes into account that | |
* such strings might partly contain `RegExp` control characters | |
* which are not supposed to be read by the `RegExp` compiler as | |
* exactly this control characters but rather shall be an integral | |
* part of such above mentioned searches. |
View Array.nth.of.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const | |
arrPrototype = Object.getPrototypeOf([]); | |
const { | |
from: arrayFrom, | |
isArray, | |
} = Array; | |
function createListOfChunkLists(arr, chunkCount) { |
View Array.nthItem.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const | |
arrPrototype = Object.getPrototypeOf([]); | |
const { | |
from: arrayFrom, | |
isArray, | |
} = Array; | |
function isFunction(type) { |
View Array.forEach.stopIteration.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const | |
arrPrototype = Object.getPrototypeOf([]); | |
const { | |
from: arrayFrom, | |
isArray, | |
} = Array; | |
function isFunction(type) { |
View createRemoveScheme.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* see: [https://stackoverflow.com/questions/66303388/how-to-most-efficiently-splice-an-array-while-looping-through-a-list-of-indices/66304184#66304184] | |
* | |
* StackOverflow :: How to most efficiently splice an array | |
* while looping through a list of indices | |
* of to be removed array items? | |
*/ | |
function createRemoveScheme(indexList, targetList) { | |
return Array |
View localeCompare.defaultCompare.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function defaultCompare(a, b) { | |
return ((a < b) && -1) || ((a > b) && 1) || 0; | |
} | |
// function localeCompare(a, b) { | |
// return a.localeCompare | |
// ? a.localeCompare(b) | |
// : defaultCompare(a, b); | |
// } | |
// - supports additional `…[, locales[, options]` argument binding |
View Boolean.isTrue.isFalse.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* `Boolean.isTrue` / `Boolean.isFalse` is a fun implementation of Smalltalk's [https://en.wikipedia.org/wiki/Smalltalk] | |
* `ifTrue` / `ifFalse` control structures [https://en.wikipedia.org/wiki/Smalltalk#Control_structures]. | |
* | |
* It is nothing one would really desire in JavaScript unless one is looking for an alternative to its native `if...else` | |
* statement and has deeply fallen in love with using function expressions all along. | |
* | |
* EN: [https://en.wikipedia.org/wiki/Smalltalk#Control_structures] | |
* DE: [https://de.wikipedia.org/wiki/Smalltalk_(Programmiersprache)#IF-Anweisung] | |
*/ |
NewerOlder