Skip to content

Instantly share code, notes, and snippets.

View ItzArty's full-sized avatar

Dávid Švihura ItzArty

View GitHub Profile
Array.prototype._sortObj = function(sortProp, sortLH, startAt, endAt) {
var returnArray = this;
if(!sortProp) {
console.error("Sorting property undefined");
return;
}
var numeric = false;
for(var i = 0; i < returnArray.length; i++) {
if(typeof returnArray[i][sortProp] == undefined) {
console.error("Not all objects have the requested property");