Skip to content

Commit 953c2db

Browse files
authored
Improve coding style
1 parent f3e09c8 commit 953c2db

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
@@ -3,7 +3,7 @@ You could note the following:
33

44
```js no-beautify
55
function pow(x,n) // <- no space between arguments
6-
{ // <- curly braces on a separate line
6+
{ // <- curly brace on a separate line
77
let result=1; // <- no spaces before or after =
88
for(let i=0;i<n;i++) {result*=x;} // <- no spaces
99
// the contents of { ... } should be on a new line
@@ -13,7 +13,7 @@ function pow(x,n) // <- no space between arguments
1313
let x=prompt("x?",''), n=prompt("n?",'') // <-- technically possible,
1414
// but better make it 2 lines, also there's no spaces and missing ;
1515
if (n<=0) // <- no spaces inside (n <= 0), and should be extra line above it
16-
{ // <- curly braces on a separate line
16+
{ // <- curly brace 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`);
1919
}

0 commit comments

Comments
 (0)