Array.prototype.flip = function () {
for (var i = 0; i < this.length / 2; i++) {
var tmp = this[this.length - i - 1];
this[this.length - i - 1] = this[i];
this[i] = tmp;
}
return this;
}
var original = "lewd i did live - evil did i dwel";
var reversed = [].flip.apply(original.split("")).join("");
Okay, maybe it's time to do some real work now.
We're a place where coders share, stay up-to-date and grow their careers.
So after doing .call(), let's do .apply(), viz
Okay, maybe it's time to do some real work now.