Electric motor was invented in 1834. DC electricity discovered in 1882. AC in 1886.
Things like Tesla coils, stun tanks, lasers, and other offensive and defensive structures and weaponry involving electricity? Why were none of these used during ww1 and 2?
Several electrically-powered weapons were used at sea in both World Wars. Every submarine in use in either war had electric motors for underwater manoeuvring (there were a few experimental exceptions using things like hydrogen peroxide for underwater fuels). They used diesel or steam engines on the surface for manoeuvring. However, these need oxygen from the air to run, and cannot be used underwater, so electric motors were used to allow them to run underwater. A few warships had a turbo-electric drive. This used a traditional steam turbine to turn a generator, which provided power to electric motors which drive the propellers. This let the turbine spin at its most efficient speed throughout; if the turbine was directly connected to the propeller shaft, then to change the speed of the ship you would have to change the speed of the turbine. However, this could be mitigated by fitting a gearbox to the propeller shaft. Doing so gave similar efficiencies to the turboelectric drive, and so it was rarely used outside of the USN. An electric transmission was also tried on a few German tanks, but proved to be heavier and harder to maintain than a mechanical transmission.
Naval mines relied heavily on electricity for their detonators. The simplest mine was the remote-controlled or 'command-detonated' mine. This had an electrically-powered detonator inside, which was connected to shore by a cable. When a ship passed over the mine, an observer on shore could flip a switch, energise the cable and set off the mine. More complex mines could operate independently. The 'Hertz Horn', developed during WWI, was a protrusion on the mine which contained an ampoule of acid. When a ship bumped into the horn, the ampoule would break, allowing the acid within to flow into a lead-acid battery. This would then generate enough current to set off the mine. Later mines had mechanical switches in the horns, or used magnetic, acoustic or pressure sensors, all electrically powered from an internal battery. In the interwar period, electrically powered torpedoes were developed. These tended to be shorter-ranged and slower than their contemporaries which used miniature steam or diesel engines, but had one key advantage. Steam-powered torpedoes needed to expel their exhaust gasses, which formed a trail of bubbles on the surface behind them; an alert lookout could spot this before the torpedo struck, allowing the target to take evasive action. Electrically powered torpedoes were trackless.
None of these weapons relied on electricity alone, though. Going through your list, we can instantly rule out lasers, for the simple reason that these were invented in 1960, 15 years after the end of WWII. They relied on observations and experiments that were not carried out until after the end of the war, and could not have been built in either war. It should also be noted that lasers are only now becoming useful weapons of war. Tesla coils had been developed before WWI, but are not useful as a weapon of war. A Tesla coil can only output power at a relatively close range, doesn't do much damage compared to a gun, and needs a lot of infrastructure to power and run it, much more than a gun. Coilguns and railguns could conceivably have been built in WWII, but suffer from a similar problem to the Tesla coil; the large amount of electricity they need to run is impractical to provide in the field. A conventional gun needs a relatively small amount of explosives to fire; a railgun or coilgun needs either battery technology that didn't exist in 1945 (and still doesn't really today), or to be plugged into a fairly major power plant which is not exactly portable. This argument applies to any other electric weapon.