Learn JavaScript in Construct, part 2: language basics

You're viewing a single comment in a conversation. View all the comments
  • 2 Comments

  • Order by
  • To be more specific, the console returns:

    "Uncaught ReferenceError: b is not defined

    at <anonymous>:1:1"

      • [-] [+]
      • 1
      • Ashley's avatar
      • Ashley
      • Construct Team Founder
      • 1 points
      • (0 children)

      That's normal - the console basically works in global scope, and it can't access variables declared in other functions (and script blocks in event sheets are actually inside functions), just like how you can't write code in one function that accesses a local variable inside a different function.