Skip to main content
Participating Frequently
December 29, 2022
Answered

SyntaxError: missing : after property id 3: at line 4

  • December 29, 2022
  • 1 reply
  • 834 views

Hello,

I'm having trouble with this script. It was working just fine until I changed the email address within the " " and I'm now receiving the error referenced in my subject. Any help would be great! The section of the code in question is:

 

// Place all prepopulation data into a single data structure
var DeptData = { Applied Geoscience, Inc.:{ contact: "Adam Moghamis",
email: "aname@email.net",
deptnum: "(555) 123-2163",
billing: "12345" },

 

I changed the contact info slightly to not give away the actual contact. This way also does not work and provides the same error.

Thanks!

This topic has been closed for replies.
Correct answer Bernd Alheit

Try this:

var DeptData = { "Applied Geoscience, Inc.":{ contact: "Adam Moghamis",
email: "aname@email.net",
deptnum: "(555) 123-2163",
billing: "12345" },
}

1 reply

Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
December 29, 2022

Try this:

var DeptData = { "Applied Geoscience, Inc.":{ contact: "Adam Moghamis",
email: "aname@email.net",
deptnum: "(555) 123-2163",
billing: "12345" },
}
Participating Frequently
December 29, 2022

Thank you!!