function onCreated() this.doMode(); function doMode(whichMode) { if (temp.whichMode) this.hasFound = true; else this.hasFound = false; }