A few lines of JavaScript
\nvar plusOne = function(digits) {\n    for (let i = digits.length - 1; i >= 0; i--) {\n        digits[i] = (digits[i] + 1) % 10;\n        if (digits[i]) return
```\nvar plusOne = function(digits) {\n    for (let i = digits.length - 1; i >= 0; i--) {\n        digits[i] = (digits[i] + 1) % 10;\n        if (digits[i]) return digits;\n    }\n    digits.unshift(1);\n    return digits;\n};\n```
['JavaScript']