patrick hollweck patrick hollweck - 3 months ago 19
Javascript Question

Javascript / Expected ')' and instead saw ';

dbRefObject.on("value", snap => {
output="preObject".stringify;
getElementById("Punkte1").innerHTML = "Punkte =" + output;
};


Hello, i cant figure out what's the problem

This is a snipset of "Firebase"'s Api and me trying to use what the database sent me in my app.

The exact error is :
JSHint
Warning
W116 - Expected ')' and instead saw ';'.at line 25 col 6 in HTML\Firebase.js

From Jshint but im also getting the same error in the Dev console in Chrome.

Answer

You are missing a closing parentheses. It should be:

dbRefObject.on("value", snap => {
 output="preObject".stringify;
  getElementById("Punkte1").innerHTML = "Punkte =" + output;
}) ;