Permalink
Browse files

Create jsonUtil.js

  • Loading branch information...
1 parent 2276f74 commit 4a8bffd3c9703e726c4df82e801e67a33d19abc8 @lenbo-ma committed Jan 30, 2013
Showing with 20 additions and 0 deletions.
  1. +20 −0 lib/jsonUtil.js
View
@@ -0,0 +1,20 @@
+
+
+/**
+ *数据合并
+ */
+
+exports.mergeJson = function mergeJson (jsonArr) {
+ var result = {};
+
+ for (var index in jsonArr) {
+
+ for (var attr in jsonArr[index]) {
+
+ result[attr] = jsonArr[index][attr];
+ }
+
+ }
+
+ return result;
+};

0 comments on commit 4a8bffd

Please sign in to comment.