Skip to content

Instantly share code, notes, and snippets.

View uolcano's full-sized avatar

uolcano uolcano

View GitHub Profile
@uolcano
uolcano / arrayLooper.js
Created July 28, 2016 15:46
Customized integrated array looper[index-specified, support forwards or backwards, break and continue]
/***************************************************************************************************
* @param {Array} [arr] [the array to be iterated]
*
* @param {Function} [process] [the callback to process the element in array]
* (elm, idx, arr, resolve)
* @description [process(elm, idx, arr, resolve) { return true; // return true to terminate current loop }]
*
* @param {Object} [options] [the iteration configurations]
* {loopStart, loopEnd, travType}
* @description [loopStart inclusive the index, loopEnd exclusive the index]