Invalid shorthand property initializer [closed]

Because it’s an object, the way to assign value to its properties is using :.

Change the = to : to fix the error.

var options = {
  host: 'localhost',
  port: 8080,
  path: "https://stackoverflow.com/",
  method: 'POST'
 }

Leave a Comment