Replace String In Array Javascript Length Function