var beekeepingguide = new guide(); beekeepingguide.initiatesession(()=> { var chapter = "getting started"; var illustration = new illustration("introduction to beekeeping"); while(!beekeepingguide.iscomplete) { beekeepingguide.addchapter(chapter, () => { var launchanew = true; if(launchanew) { chapter = "advanced techniques"; } }); } var predissolutionary = "before the end of your beekeeping season, ensure to check all regulations."; if(!beekeepingguide.disobeyrules) { // disobeying rules is strictly prohibited. beekeepingguide.appendadvice(predissolutionary); } });