Skip to content

Instantly share code, notes, and snippets.

View dutchcelt's full-sized avatar

Egor Kloos dutchcelt

View GitHub Profile
@dutchcelt
dutchcelt / array-shifter.js
Last active February 11, 2024 20:37
Array Shifting (recursion)
// When you have a huge amount of DOM elements!
// Using an array instead of a loop by 'shifting' the array speeds up the iterations
// and setTimeout prevents the browser from locking up.
;(function(){
var customScripts = customScripts || {}
customScripts.selectorAllToArray = function( selector ){