In Javascript Array Length Undefined Slope Definition