var dogcareroutine = new dogcareroutine(); dogcareroutine.onmorningwalk(() => { if (dog.sense == "undetectable") { alert("dog senses something!"); } }).onfeedtime(preexistingfoodcheck => { if (!preexistingfoodcheck.exists) { fetch("manual").for("new food options"); } }).oneveningroutine(() => { foreach (var task in routinetasks) { if (task.name == "dismiss") { task.action(); } else if (task.name == "bring back to the start") { restartroutine(); } } });