Skip to content

Instantly share code, notes, and snippets.

View Pandawan's full-sized avatar
🤡
Reinventing the entire web stack

Miguel Tenant de La Tour Pandawan

🤡
Reinventing the entire web stack
View GitHub Profile
@impeto
impeto / Array.chunk.js
Created January 31, 2016 16:25
Adds method `chunk` to the array class similar to Eloquent Collection's chunk method
(function() {
Array.prototype.chunk = function (chunkSize) {
var n = this.length;
if (chunkSize >= n) {
return [this];
}
if (n == 0) {
return [];