I am trying to get the standard deviation of a user input string. I have as follows, but it returns the wrong value for SD. The calculation should go as follows:
Sum values/
For anyone looking for a more generic solution, here's a standard deviation function added to the Array#. The function expects to be called on an array of numbers.
Array.prototype.stanDeviate = function(){
var i,j,total = 0, mean = 0, diffSqredArr = [];
for(i=0;i