javascript two solution
Case.1\n\nvar sortArrayByParity = function(A) {\n    const temp = [];\n    A.forEach(v => {\n        v % 2 === 0 ? temp.unshift(v) : temp.push(v);\n    })\n    
Case.1\n```\nvar sortArrayByParity = function(A) {\n    const temp = [];\n    A.forEach(v => {\n        v % 2 === 0 ? temp.unshift(v) : temp.push(v);\n    })\n    \n    return temp;\n};\n```\n\nCase.2\n```\nvar sortArrayByParity = function(A) {\n    return [...A.filter(v => v % 2 === 0), ...A.filter(v => v % 2 !== 0)];\n};\n```
['JavaScript']