Earlier quoted context omitted.
Depends, if you are turning that electricity into heat using a heat-pump you might win on most situations (maybe lose if the weather is really cold outside, unless you add geothermal loops, but then its a lot more expensive to make)
No it wouldn't depend. Electricity generation and electricity transfer has losses. Gas transfer has loss only if there is a leak.
Burning gas to heat a home means "1kWh" of gas, delivers ~1kWh of heat.
Modern gas power plants are about 55 to 60% efficient, so "1kWh" of gas becomes ~0.57kWh of electricity, which after transport losses (-6%) arrives at the home as 0.52kWh, which gets turned into 1.5 to 2.0kWh of heat.
=> It's almost two times as efficient to turn gas into electricity and use heat pumps in the home