en.javascript.info/1-js/03-code-quality/02-coding-style/1-style-errors/task.md
Ilya Kantor 7019d1470d up
2017-02-23 19:03:14 +03:00

28 lines
369 B
Markdown

importance: 4
---
# Bad style
What's wrong with the code style below?
```js no-beautify
function pow(x,n)
{
let result=1;
for(let i=0;i<n;i++) {result*=x;}
return result;
}
let x=prompt("x?",''), n=prompt("n?",'')
if (n<=0)
{
alert(`Power ${n} is not supported, please enter an integer number greater than zero`);
}
else
{
alert(pow(x,n))
}
```
Fix it.