Created
May 27, 2014 09:43
-
-
Save taclab/3aee2c8e8e27f63567d3 to your computer and use it in GitHub Desktop.
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 characters
| issues = [{"borrowernumber":"16595","itemnumber":"406731","biblionumber":"97756","date_due":"2013-02-05","branchcode":"BUP8","issuingbranch":"","returndate":"2013-01-24","lastreneweddate":"","return":"","renewals":"0","timestamp":"2013-01-24 16:56:07","issuedate":"2013-01-22","inhouse_use":"0","sex":"M","dateofbirth":"1991-07-18","categorycode":"3BUP8","Ufr":"ARTS","Niveau":"L3","Etape":"L3APLA","$$hashKey":"06T"},{"borrowernumber":"61204","itemnumber":"406731","biblionumber":"97756","date_due":"2013-02-08","branchcode":"BUP8","issuingbranch":"","returndate":"2013-02-08","lastreneweddate":"","return":"","renewals":"0","timestamp":"2013-02-08 14:58:13","issuedate":"2013-01-25","inhouse_use":"0","sex":"M","dateofbirth":"1975-03-17","categorycode":"3BUP8","Ufr":"ARTS","Niveau":"M2","Etape":"AGAPLA","$$hashKey":"06U"},{"borrowernumber":"22172","itemnumber":"131352","biblionumber":"97756","date_due":"2013-02-15","branchcode":"BUP8","issuingbranch":"","returndate":"2013-02-11","lastreneweddate":"","return":"","renewals":"0","timestamp":"2013-02-11 15:48:47","issuedate":"2013-01-18","inhouse_use":"0","sex":"M","dateofbirth":"1986-10-19","categorycode":"3BUP8","Ufr":"ZZ","Niveau":"ZZ","Etape":null,"$$hashKey":"06V"}] | |
| var unique = function(data, key) { | |
| var result = []; | |
| for(var i=0;i<data.length;i++) { | |
| var value = data[i][key]; | |
| if (result.indexOf(value) == -1) { | |
| result.push(value); | |
| } | |
| } | |
| return result; | |
| }; | |
| var uniqueItem = unique(issues, 'itemnumber'); | |
| // ["406731", "131352", "131351", "131350", "131355", "131358", "131354", "131356"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment