Skip to content

Tag: javascript

Group results of multiple POST API calls

I use the below script to loop through the input (skipping first one) to post some data to my API. Result How can I capture the combined response of both calls into a variable I can use later on in my script? something like var allNum = res.result.number[0]? This is what I want -> Var allTens = “002,…

Plotly.js 3D scatter plot is just black

This is something that has recently broken. Previously, I was getting normal plots when running the exact same code however now the plot is just a black screen. (Pictured Below) I am not sure what changed. I tried reverting to an older version of plotly but that did not fix it. I do not even know where to beg…

Initialise an object with array properties

How can I initialise an object in JavaScript, the properties of which would be arrays? I want to have an object of this format: My usecase is the following: – When a property does not exist, create this property which should be an array and add a number. – When a property exists already, push the …

Changing an object value from a Class

I have a js file handling my css where I am trying to change the value of an object, but the value stays the same. I assume the “this.opacity” is only returning a reference and not modifying the actual object and I am unsure of how to make this object mutable. How would I go about changing this va…