Transform String Into Array Javascript Length Function