[JavaScript] Clean and fast solution with explanation.(No reverse)
js\nvar addToArrayForm = function(A, K) {\n    let flag = A.length - 1\n    while(K) {\n        if(flag < 0) {\n            A.unshift(K % 10)\n        } else {\
```js\nvar addToArrayForm = function(A, K) {\n    let flag = A.length - 1\n    while(K) {\n        if(flag < 0) {\n            A.unshift(K % 10)\n        } else {\n            K += A[flag]\n            A[flag--] = K % 10\n        }\n        K = Math.floor(K / 10)\n    }\n    return A\n}\n```\nExplanation:\n1. Take `K` as a carry.\n2. Use `flag` to point from right to left (from lower to higher digit).\n3. If `flag` less than 0, it means `A` need to insert a new digit to the head of `A`.
['JavaScript']