-
• #2
Hi,
reset is a reserved function name. Try a different argument name like thisE.showPrompt("Reset the score\nto 0-0?").then( (res) => { if (res) { this.game.resetScore(); } this.activateGameButtons(); });
Hi,
reset is a reserved function name. Try a different argument name like this
E.showPrompt("Reset the score\nto 0-0?").then( (res) => {
if (res) {
this.game.resetScore();
}
this.activateGameButtons();
});
Hi
I'm having problems to make following code work...
After pressing BTN2 I get my prompt and when selecting "yes" or "no" I get the following error (full error in attachment):
Is there something wrong with my Javascript code ? To me it looks like arrow functions aren't supported in promises. Because in other places, arrow functions work fine. When using 'function (reset) {}' instead of '(reset) => {}' I can enter the function, but then I'm having trouble with the "this scope".
(I'm a Javascript noob, so it might just be wrong Javascript code I guess :-))
1 Attachment