Javascript Solution
\nvar sortArrayByParity = function(A) {\n  let i = 0;\n  let j = A.length -1;\n\n  while(i < j) {\n    if (A[i] % 2 !== 0 && A[j] % 2 === 0) {\n      let temp =
```\nvar sortArrayByParity = function(A) {\n  let i = 0;\n  let j = A.length -1;\n\n  while(i < j) {\n    if (A[i] % 2 !== 0 && A[j] % 2 === 0) {\n      let temp = A[i];\n      A[i] = A[j];\n      A[j] = temp;\n    }\n\n    if (A[i] % 2 !== 0) {\n      j--;\n    }\n\n    if(A[i] % 2 === 0) {\n      i++;\n    }\n  }\n\n  return A;\n};\n```
['JavaScript']