Pregnancy and drug use

🎀💖

***** I am not pregnant just curious about this because I know it happens*****

So my question is, if the mom is unaware she's pregnant and is doing recreational drugs and drinking and stuff how does it affect the baby at the beginning? Will it still have problems even if she stops as soon as she finds out she's pregnant?