I hereby claim:
- I am pritoj on github.
- I am pritoj (https://keybase.io/pritoj) on keybase.
- I have a public key ASC3naa4Zg6x0J367dguqV6LuSBetlrA12AYfcKDuVm3Hgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
// Array hug, one array hugs the other | |
// If the hugger is odd numbered, more in the front | |
Array.prototype.hug = function(arr){ | |
let hugged = this.slice(0,Math.ceil(this.length/2)); | |
hugged.push(...arr); | |
hugged.push(...this.slice(Math.ceil(this.length/2), this.length)); | |
return hugged; | |
} | |
// Array spoon, one array spoons the other |
// Array hug, one array hugs the other | |
// If the hugger is odd numbered, more in the front | |
Array.prototype.hug = function(arr){ | |
let hugged = this.slice(0,Math.ceil(this.length/2)); | |
hugged.push(...arr); | |
hugged.push(...this.slice(Math.ceil(this.length/2), this.length)); | |
return hugged; | |
} |