Skip to content

Commit 2020876

Browse files
authored
Merge pull request #3977 from Lk-ux/patch-3
Convert prompt inputs to numbers with unary plus
2 parents 725653f + a197375 commit 2020876

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • 1-js/02-first-steps/15-function-basics/4-pow

1-js/02-first-steps/15-function-basics/4-pow/solution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ function pow(x, n) {
1010
return result;
1111
}
1212

13-
let x = prompt("x?", '');
14-
let n = prompt("n?", '');
13+
let x = +prompt("x?", '');
14+
let n = +prompt("n?", '');
1515

1616
if (n < 1) {
1717
alert(`Power ${n} is not supported, use a positive integer`);

0 commit comments

Comments
 (0)