I am doing stuff inside the console to try and simulate some code that exists in production.
It takes a callback from a call to an API and then does some stuff with the data returned.
Its quite standard stuff but I am trying to simulate the data object that the server returns from my code and I am getting nowhere.
I want to end up some a kind of object that I can assign custom param/value pairs to so that I can access it via dot syntax. E.g.
myObject.thing = value
This is the format that the data from the API returns in.
Is there a way in the console to create an anonymous object, then assign the values myself and use that to run through my code?
Inside the console type the below:
Here we define a class with a param/property, then instantiate an object.
We assign a value to the param and pass this object (with
param/value) into a function (yourcode) which processes the data from here.hope that helps