While Loop Through String Javascript Methods List