In Javascript Array Length Undefined Slope