Note: fasting does not necessarily mean total abstinence from nutrition. Fasts can be more or less restrictive, so we shouldn’t jump to conclusions here.
Fasting is controversial within the medical community. That said, there is no evidence that intermittent fasting—that is, extending the period between meals—is harmful to the body (assuming a lack of special issues relating to the digestive tract). Moreover, it can give your body a chance to prepare itself for newer and healthier eating habits.
Fasting is not typically recommended for the specific purpose of weight loss, but it can help break food addictions (and, according to some, drug addictions due to the mental discipline it teaches). Breaking food addictions and taking on better eating habits afterwards can help with general health, including weight loss, by leading to a diet that is less likely to increase blood pressure and blood sugar.
While it is perhaps not the best source, here is a WebMD article about fasting.