sort1 json 배열 합치기(merge) 및 소팅하기 var by = function (name) { return function (o, p) { var a, b; if (typeof o === 'object' && typeof p === 'object' && o && p) { a = o[name]; b = p[name]; if (a === b) { return 0; } if (typeof a === typeof b) { return a > b ? -1 : 1; } return typeof a > typeof b ? -1 : 1; } else { throw { name: 'Error', message: 'Expected an object when sorting by ' + name }; } }; };alerts2 = [{ "id": "test", "comm.. 2016. 1. 13. 이전 1 다음