Skip to content

Instantly share code, notes, and snippets.

View KashifAhmed's full-sized avatar
🎯
Focusing

Kashif Ahmed KashifAhmed

🎯
Focusing
View GitHub Profile
@KashifAhmed
KashifAhmed / calculation.js
Created June 21, 2019 08:16
You have an array of objects in JavaScript. Each one contains a name (a string) and ranking (a number). Write two functions, one to return the objects ordered by ranking and another to return the average ranking.
let result = [{
name: "Jhon",
rank: 3
},{
name: "Smith",
rank: 1
},{
name: "Kyel",
rank: 4
},{