updated changes
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
### Number to array of digits
|
### Number to array of digits
|
||||||
|
|
||||||
use `parseInt()` to get only the integer part of the quotient.
|
Convert the number to a string, split the string using `split()`.
|
||||||
use `Array.reverse()` to return the array in the same order as the number.
|
use `parseInt()` to convert every element back to integer.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const num2array = (n) =>{
|
const num2array = (n) =>{
|
||||||
|
|||||||
Reference in New Issue
Block a user