Created
November 2, 2022 06:03
-
-
Save hemedani/06885fd74e273c2f598777828d973f72 to your computer and use it in GitHub Desktop.
create number from an array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const arr = [5, 6, 5, 4, 7, 8]; | |
const nums = arr.map((number, index, arr) => number * 10 ** (arr.length - 1 - index)); | |
console.log("the final number is ", nums); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment