javascript solution
\nvar sortArrayByParity = function(A) {\n    let i = 0;\n    let j = A.length - 1;\n    while(i < j){\n      if(A[i] % 2 === 0){\n        i++;\n        continue
```\nvar sortArrayByParity = function(A) {\n    let i = 0;\n    let j = A.length - 1;\n    while(i < j){\n      if(A[i] % 2 === 0){\n        i++;\n        continue;\n      }\n      if(A[j] % 2 === 1){\n        j--;\n        continue;\n      }\n      if(A[i] % 2 === 1 && A[j] % 2 === 0){\n        const temp = A[i];\n        A[i] = A[j];\n        A[j] = temp;\n        i++;\n        j--;\n      }\n    }\n    return A;\n};\n```
[]