Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function SORT(a,b) {
- if (a[1] < b[1]) { return -1}
- else if (a[1] === b[1]) {return 0}
- else return 1
- }
- function PROCESS(array){
- array.sort(SORT)
- for (i = 0; i <= array.length-1 ; i++){
- //this first loop starts the next loop for every single value in the second column
- var Name = String(array[i][0])
- //this second loop eliminates all duplicate times, except the highest time for that author
- for (j = array.length-1;j >= i+1 ; j--){
- if (Name === String(array[j][0])){
- array.splice(j,1)
- }
- }
- }
- return array
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement