Since the lifespan of the James Webb Space Telescope is determined by the amount of fuel it can carry for its thrusters, used to decelerate the reaction wheels used to orient the telescope, and since the telescope already uses solar power and if it didn't have to dump the momentum of said wheels using a more limited resource, and used electric thrusters instead, would it be able to last longer? And if we've had this technology for a while before the launch (quote from Wikipedia "As of 2019, over 500 spacecraft operated throughout the Solar System use electric propulsion for station keeping, orbit raising, or primary propulsion."), would replacing the standard thruster system with electric thrusters have been worth the extra time and money to replace or add in addition to chemical thrusters?
There are a couple of design choices that might have affected the decision of using chemical thrusters.
First, the propulsion systems of the JWST were used to correct the insertion trajectory to the final orbit, electrical thrusters were probably just not enough to do this. (Keep in mind JWST is a big spacecraft and requires powerful propulsion to match).
Second, electric thrusters have a really high DV but really low thrust, which means you'll have to keep them operating (and using power from the spacecraft systems), for very long periods of time.
Additional to that, all the time the electric thrusters are operating (it could be days or even weeks at the time) are going to generate a lot of heat. Since the JWST is a infrared telescope this would interfere heavily with the measurements. The payload has to be at 50 Kelvin (-370°F, or -223°C) (Sunshield), so a lot of effort was put into insulating the actual payload using the sunshield.
Chemical thrusters might be less efficient, but have a very high thrust, which means you can fire them by seconds or even fraction of seconds at the time, and require very little power when compared to electrical ones.
Had electrical thrusters been an option, then they would have probably extended the life of JWST, but because of other requirements, they were not.
Electric thrusters really have only one advantage over chemical ones: you need less fuel for the same momentum change. In particular less mass of fuel. The measure that directly expresses this is the specific impulse.
High specific impulse has a huge advantage if you need a lot of Δv, whether for launching out of a deep gravity well, for getting to a destination quickly, for constant adjustments of a LEO orbit or for visiting multiple asteroids.
What is "a lot"? What I mean is, if you need a higher mass of fuel than payload. Because then you mainly use the fuel to accelerate the other fuel, which requires more fuel... thats the "tyranny of the [Tsiolkovsky] rocket equation" effect. An easy way to see if you're in that domain is by comparing the required Δv with the effective exhaust velocity of the engine. If you're in the tyrannical domain, using a lower-Isp engine leads to an exponential penalty in launch mass.
In a sense, any space mission is in the tyrannical domain from the get-go, because even getting LEO requires a Δv higher than the exhaust velocity of any chemical engine. But electrical engines can't be used for launch, nor are they practical for getting out of Earth's gravity well. JWST used Ariane for all that, which like all orbital boosters is huge – no way to get around the exponential growth at that point!
For the actual insertion / station keeping however, JWST does not need a great lot of Δv, and thus only carried 276 kg of fuel, much less than the ≈6 tonnes dry mass. Changing this mass wouldn't have made a fundamental change to the launch requirements. If they had seen a big enough advantage of packing in more fuel, they could certainly have made it possible; the other way around, switching to electric thrusters to reduce the fuel mass would not have enabled them to use a cheaper launcher. (In fact, even dramatic mass savings wouldn't have changed anything about the large size, which alone makes a big-fairing launcher necessary.)
That said, any mass that can be saved on spacecraft is of course good – but it needs to be weighed (pun not intended) against any disadvantages, and electric thrusters certainly have some of those, as said by Gabriel Sanchez. OTOH, if the Δv requirements had necessitated taking 10 tonnes of hydrazine with them, they would probably not have done that but instead used hall thrusters and worked around their drawbacks in some other way.
There may have been 500 electric-propulsion spacecraft in operation in 2019, but the contract to build JWST was signed in 2003, when there were far fewer. Electric propulsion may be a mature technology today, but back then, it was still experimental.
Yes, an electric JWST would have far greater ability to dump the accumulated momentum of the reaction wheels, but an electric JWST would also have a higher risk of propulsion failure causing premature end-of-mission. Understandably, NASA went with the low-risk, mature technology of chemical thrusters.