Answers for "Write Number in Expanded Form You will be given a number and you will need to return it as a string in Expanded Form. For example:"

-1

Write Number in Expanded Form You will be given a number and you will need to return it as a string in Expanded Form. For example:

const expandedForm = n => n.toString()
                            .split("")
                            .reverse()
                            .map( (a, i) => a * Math.pow(10, i))
                            .filter(a => a > 0)
                            .reverse()
                            .join(" + ");
Posted by: Guest on October-24-2020

Code answers related to "Write Number in Expanded Form You will be given a number and you will need to return it as a string in Expanded Form. For example:"

Browse Popular Code Answers by Language