Created
February 20, 2018 02:18
-
-
Save AlexxNica/6ec31f78e5cdb88c3505e56e09bf12c1 to your computer and use it in GitHub Desktop.
This file contains 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
'use strict'; | |
const originalArray = [1, 2, 3, 4]; | |
const sumArray = (arr: number[], times: number) => { | |
const totalNumber = Number(arr.join('')); | |
const numberSummed: number = totalNumber + times; | |
const arrayAfterSum = numberSummed.toString().split(''); | |
console.log('totalNumber:', totalNumber); | |
console.log('numberSummed:', numberSummed); | |
console.log('arrayAfterSum:', arrayAfterSum); | |
}; | |
sumArray(originalArray, 91285012387128); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment