Skip to content

Instantly share code, notes, and snippets.

View pedro-surf's full-sized avatar
🎯
Focusing

Pedro Silveira pedro-surf

🎯
Focusing
View GitHub Profile
func1 = (myObjArray) => {
myObjArray.sort((a,b) => { return a.ranking - b.ranking; });
};
func2 = (myObjArray) => {
let acc = 0;
let len = myObjArray.length;
for(let i=0; i<len; i++) {
acc = acc + myObjArray[i].ranking;