the function passes all test except the last one, which is exponentialGenerator(25) should return 784
and it returns 729 instead, why? Your code so far
function exponentialGenerator(n) {
var arr = [];
for (let i = 2; arr.length <= n; i++) {
if (!Number.isInteger(Math.pow(i, 2/3))) {
arr.push(Math.pow(i, 2))}
}
return arr[n]
}
console.log(exponentialGenerator(25))
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36.
but what does this do then? what’s the problem here that it’s not filtering?
ik you could have an array of cubes and use .filter and .includes but what’s the problem particularly here?
that’s rude, if i use round normally it will also be an integer for non cubic numbers, i always have those damn round off problems , how can i prevent them (if there’s any way, even at other laguages with int keyword or stuff)