Skip to content

Instantly share code, notes, and snippets.

@ms314006
Created March 10, 2020 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ms314006/9af159b156963b71cb4ca6b4b39285b1 to your computer and use it in GitHub Desktop.
Save ms314006/9af159b156963b71cb4ca6b4b39285b1 to your computer and use it in GitHub Desktop.
var plusOne = function(digits) {
// 總合 join => Number => String => split => map
return String((Number(digits.join('')) + 1)).split('').map(digit => Number(digit));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment