# Problem with the diversion of prompt

• Starting `power(number, exponent)` with parameters `var number = defineNumber();`when the prompt value is not inserted, after its reintroduction, zero shall be removed. What does that have to do with it?

``````function power(number, exponent) {
var number = defineNumber();
if (number === null) {
return false;
}
var exponent = defineExponent();
if (exponent === null) {
return false;
}
var res = calc();
function defineNumber(val) {
var x = prompt("ВВЕДИТЕ ЛЮБОЕ ЧИСЛО", val || '');
if (x === '') {
defineNumber(val);
}
return x;
}
function defineExponent(val) {
var n = prompt("ВВЕДИТЕ ЖЕЛАЕМЫЙ ПОКАЗАТЕЛЬ СТЕПЕНИ", val || '');
if (n === '') {
defineExponent(val);
}
return n;
}
function calc() {
var result;
if (+exponent === 0) {
result = 1; // если показатель степени  = 0
}
if (+exponent &gt; 0) {

result = +number; // если показатель степени  положительный
for (var i = 1; i &lt; +exponent; i++) {
result *= +number
};
}

if (+exponent &lt; 0) {
result = 1 / +number; // если показатель степени  отрицательный
for (var i = +exponent; i &lt; -1; i++) {
result *= (1 / [+number])
};
}
return result;

}
console.log(res);
return res;
}
``````

• The problem is that the value requested is not returned again:

``````if (x === '') {
defineNumber(val);
}
``````

And the first line, empty, is returned, which is exactly 0.

It is sufficient for the solution to return this value:

``````if (x === '') {
return defineNumber(val);
}
``````

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2