Chromata
Chromata

Reputation: 47

missing ) after argument list, where do i put it?

It says I'm missing ) after an argument list. Could someone help me? Here's the link.

if (typeof scriptTwoLoaded === "undefined") {
var scriptTwoLoaded = true;
var hideRockCount = false;
var RockCaught = 0;
}

MPP.client.on("a", (msg) => {
    if (msg.a.indexOf(MPP.client.getOwnParticipant().name + " Finished digging " )!== -1 && msg.p._id === ("d45525193b7bfaba58aa23ad")) {
         MPP.chat.send("~dig")
 }}});

Upvotes: 1

Views: 53

Answers (1)

Prasanth
Prasanth

Reputation: 418

And that's the reason to use proper indentation,

if (typeof scriptTwoLoaded === "undefined") {
  var scriptTwoLoaded = true;
  var hideRockCount = false;
  var RockCaught = 0;
}

MPP.client.on(
  "a", 
  (msg) => {
    if (msg.a.indexOf(MPP.client.getOwnParticipant().name + " Finished digging " )!== -1 && msg.p._id === ("d45525193b7bfaba58aa23ad")) {
      MPP.chat.send("~dig")
    }
  }
);

See, How readable it is.

Btw, There was a extra '}' in the last line. It should be '}});'

Upvotes: 1

Related Questions