create array from another array object properties javascript code example Example: number to array js const arrayOfDigits = numToSeparate.toString().split("");