Skip to content

Commit b7257ec

Browse files
LaroccaLarocca
authored andcommitted
1 parent a3fb79b commit b7257ec

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

addTwoDigits/addTwoDigits.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { addTwoDigits } from './addTwoDigits';
22

3-
xdescribe(addTwoDigits.name, () => {
3+
describe(addTwoDigits.name, () => {
44
it('Test 1', () => {
55
// arrange
66
const data = 29;

addTwoDigits/addTwoDigits.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
1+
12
export function addTwoDigits(n: any): number {
23

4+
const numberToString = n.toString();
5+
console.log(typeof numberToString)
6+
7+
const numberArray = numberToString.split('');
8+
console.log(numberArray)
9+
10+
const numberOne = parseInt(numberArray[0]);
11+
console.log(typeof numberOne)
12+
13+
const numberTwo = parseInt(numberArray[1]);
14+
console.log(typeof numberTwo)
15+
16+
const total = numberOne + numberTwo;
17+
console.log(total);
18+
19+
return total;
320
}
421

5-
// console.log(addTwoDigits(29));
22+
console.log(addTwoDigits(29));

0 commit comments

Comments
 (0)