[JS/TS] Beats > 90% | Super Simple Fixed Array length approach
Runtime - Beats\n76 ms - 92.39%\n\nMemory - Beats\n45.5 MB - 97.76%\n\nHere we use an Array of a fixed length and insert the number of the nums array to the ans
Runtime - Beats\n76 ms - 92.39%\n\nMemory - Beats\n45.5 MB - 97.76%\n\nHere we use an Array of a fixed length and insert the number of the nums array to the ans array.\nBy inserting the number in both destinations at once we\'re more efficient than e.g. spreading the array twice. \n\nThe creation of the fixed length array also reduces a lot internal copying compared to a ".push()" solution. \n\n# Code\n```\nfunction getConcatenation(nums: number[]): number[] {\n    const len = nums.length;\n    const ans = new Array(2 * len);\n  \n    for (let i = 0; i < len; i++) {\n        ans[i] = nums[i];\n        ans[i + len] = nums[i];\n    }\n  \n    return ans;\n};\n```
['Array', 'TypeScript', 'JavaScript']