Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Larocca authored and Larocca committed Sep 30, 2022
1 parent a3fb79b commit b7257ec
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion addTwoDigits/addTwoDigits.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { addTwoDigits } from './addTwoDigits';

xdescribe(addTwoDigits.name, () => {
describe(addTwoDigits.name, () => {
it('Test 1', () => {
// arrange
const data = 29;
Expand Down
19 changes: 18 additions & 1 deletion addTwoDigits/addTwoDigits.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@

export function addTwoDigits(n: any): number {

const numberToString = n.toString();
console.log(typeof numberToString)

const numberArray = numberToString.split('');
console.log(numberArray)

const numberOne = parseInt(numberArray[0]);
console.log(typeof numberOne)

const numberTwo = parseInt(numberArray[1]);
console.log(typeof numberTwo)

const total = numberOne + numberTwo;
console.log(total);

return total;
}

// console.log(addTwoDigits(29));
console.log(addTwoDigits(29));

0 comments on commit b7257ec

Please sign in to comment.