Beautiful one-liner flatMap+map solution
Code\n\n/**\n * @param {number[]} nums\n * @return {number[]}\n */\nvar separateDigits = function(nums) {\n    return nums.flatMap(num => String(num).split(\'\'
# Code\n```\n/**\n * @param {number[]} nums\n * @return {number[]}\n */\nvar separateDigits = function(nums) {\n    return nums.flatMap(num => String(num).split(\'\').map(Number));\n};\n```
['JavaScript']