How come it shows up as NaN even though it is a number?
I'm confused. So this was a project for my Dad to calculate mean deviation. But then i was like yay it should work and the JavaScript looked ok, but what was wrong with innerHTML?
because it said NaN instead of the actual mean deviation.
please help.
Coder100
Can I ask why you are doing Number(meanDev)
and then discarding the result?
Coder100
where?
ComputingSquid
wait what @Coder100
Coder100
ok read my solution
this is a very big mistake never ever do this again @ComputingSquid
ComputingSquid
thank you @Coder100
Coder100
no problem :) mark as correct answer? @ComputingSquid
ComputingSquid
i did your welcome @Coder100
ok so basically the error is that all the
meandev
variables are not defined:This is because in your function:
You don't own
meanDev
(meaning you can't change the variable that gave you that value). The solution is to just return the value.Solution
ALSO ADD SEMICOLONS THIS IS NOT PYTHON
ok fine @Coder100
so did your problem get solved @ComputingSquid
@Coder100

nope
😢 sad @Coder100
what was your input @ComputingSquid
um you didn't even use my code @ComputingSquid
oops @Coder100
lol your code has to be
didn't I tell you lol
@ComputingSquid
ok fixed i think @Coder100
awesome @ComputingSquid
not again it still is not fixed @Coder100
why are you still not using my code @ComputingSquid
why are you not setting the variable
You have
I have
@ComputingSquid
i am @Coder100
no you are not look at what I have and look at what you have you have to set the variable to that value @ComputingSquid
my function only returns the result you have to set that result to the variable smh @ComputingSquid
yay ok it works i think @Coder100
yay @ComputingSquid
we commented so much we at top of feed lol

@Coder100
lmao @ComputingSquid
haha @Coder100
lol @ComputingSquid
who knew comments had that much impact xD @ComputingSquid
me: 🤣🤣🤣🤣🤣🤣🤣 @Coder100
lol @ComputingSquid
i dunno maybe i should advertise my repls on my post haha @Coder100
lmao @ComputingSquid
haha @Coder100