Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 01e584f

Browse files
update solution.md
There are some missing "=" sign according to the question.
1 parent 340ce43 commit 01e584f

File tree

1 file changed

+2
-2
lines changed
  • 1-js/03-code-quality/02-coding-style/1-style-errors

1 file changed

+2
-2
lines changed

‎1-js/03-code-quality/02-coding-style/1-style-errors/solution.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function pow(x,n) // <- no space between arguments
1212

1313
let x=prompt("x?",''), n=prompt("n?",'') // <-- technically possible,
1414
// but better make it 2 lines, also there's no spaces and missing ;
15-
if (n<0) // <- no spaces inside (n < 0), and should be extra line above it
15+
if (n<=0) // <- no spaces inside (n <= 0), and should be extra line above it
1616
{ // <- figure bracket on a separate line
1717
// below - long lines can be split into multiple lines for improved readability
1818
alert(`Power ${n} is not supported, please enter an integer number greater than zero`);
@@ -39,7 +39,7 @@ function pow(x, n) {
3939
let x = prompt("x?", "");
4040
let n = prompt("n?", "");
4141

42-
if (n < 0) {
42+
if (n <= 0) {
4343
alert(`Power ${n} is not supported,
4444
please enter an integer number greater than zero`);
4545
} else {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /