{"ScriptPreparationCode":null,"TestCases":[{"Name":"lodash union","Code":"var a = [ \u0027a\u0027, \u0027b\u0027, \u0027c\u0027 ];\r\nvar b = [ \u0027b\u0027, \u0027d\u0027, \u0027a\u0027, \u0027e\u0027, \u0027f\u0027 ];\r\nvar c = _.union(a, b);","IsDeferred":false},{"Name":"object.assign","Code":"var a = [ \u0027a\u0027, \u0027b\u0027, \u0027c\u0027 ];\r\nvar b = [ \u0027b\u0027, \u0027d\u0027, \u0027a\u0027, \u0027e\u0027, \u0027f\u0027 ];\r\nvar c = Object.assign([], a, b);","IsDeferred":false},{"Name":"lodash uniq spread","Code":"var a = [ \u0027a\u0027, \u0027b\u0027, \u0027c\u0027 ];\r\nvar b = [ \u0027b\u0027, \u0027d\u0027, \u0027a\u0027, \u0027e\u0027, \u0027f\u0027 ];\r\nvar c = _.uniq([...a, ...b]);","IsDeferred":false},{"Name":"spread","Code":"function arrayUnique(array) {\r\n var a = array.concat();\r\n for(var i=0; i\u003Ca.length; \u002B\u002Bi) {\r\n for(var j=i\u002B1; j\u003Ca.length; \u002B\u002Bj) {\r\n if(a[i] === a[j])\r\n a.splice(j--, 1);\r\n }\r\n }\r\n\r\n return a;\r\n}\r\n\r\nvar array1 = [ \u0027a\u0027, \u0027b\u0027, \u0027c\u0027 ];\r\nvar array2 = [ \u0027b\u0027, \u0027d\u0027, \u0027a\u0027, \u0027e\u0027, \u0027f\u0027 ];\r\n // Merges both arrays and gets unique items\r\nvar array3 = arrayUnique(array1.concat(array2));","IsDeferred":false}]}