As weight-loss plans go, it’s easy to see the allure of intermittent fasting: Eat what you want, but only during certain windows of time.