Nothing is black or white.
Do you think is better for environment to throw all the cars before they reach their useful life to buy new cars that use bigger batteries (one of the main toxic car parts)? How do you create enough electricity for all those cars? Is the electrical installation of the cities enough to support all those cars recharching during the night (ask UK that's already facing this problem)? An electric super car is gonna have less environmental footprint than a small urban car with latest petrol innovations? It will be the same if the electric super car is recharged using green electricity than if you need a carbon power plant to create that energy? How many miles do you need to do per year, to make the battery worthy and make it more friendly than the petrol car?
On paper, it looks beautiful, and I'm sure that if we stress car manufacturers like we are doing right now, they will find better solutions for batteries and how to handle them after their useful life to be greener in the future while we invest more on green/nuclear energy, but I don't think we are on the point this is sustainable in few years.
Studies points that an average petrol car emits 275gr co2 per mile while an electric car emits 200gr co2.
“Producing electric vehicles leads to significantly more emissions than producing petrol cars. Depending on the country of production, that’s between 30% to 40% extra in production emissions, which is mostly from the battery production,