Created
December 5, 2016 18:43
-
-
Save Amitesh/a6cea576f38fda8111d19fb0c22f26bc to your computer and use it in GitHub Desktop.
Revisions
-
Amitesh created this gist
Dec 5, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ /** * Sort an array of object. */ var sample = [ { name: 'Ram', age: 21 }, { name: 'Shyam', age: 37 }, { name: 'Gyan', age: 45 } ]; sample.sort(function(a,b) { return a.age - b.age; });