JavaScript Code
\n# Code\n\n/**\n * @param {number[]} nums\n * @return {number[]}\n */\nvar sortArrayByParity =(nums)=>{\n    let j=0;\n    for(let i = 0;i<nums.length;i++)\n  
\n# Code\n```\n/**\n * @param {number[]} nums\n * @return {number[]}\n */\nvar sortArrayByParity =(nums)=>{\n    let j=0;\n    for(let i = 0;i<nums.length;i++)\n    {\n        if(nums[i]%2==0)\n        {\n            let temp=nums[j];\n            nums[j]=nums[i];\n            nums[i]=temp;\n            j++;\n        }\n    }\n    return nums;\n};\n```
['JavaScript']