That is not quite true. Electric cars over their lifetime are definitely a lot lot better than ICE cars. HOWEVER, they are definitely not the solution for transportation. Public transit is.
Getting new electric vehicles makes sense for vehicles that simply cannot be replaced by other alternatives (examples of such vehicles being pickups for businesses, those little vans for the post office, buses, etc.).
Of course, the most eco friendly thing is generally what u already have. Switching to an electric car from ur five year old ICE car is more environmentally damaging.