I am currently facing an issue with an assignment in my function.
Here is a snippet of the function along with the troubleshooting console.log statements:
function myfunc()
{
the_node = some_array; //with data.$color = #111111
console.log('before: '+the_node.data["$color"]); //returns #111111
console.log(the_node); //returns #111111 (at data.$color)
the_node.data["$color"] = "#000000" ; //the assignment
console.log('after: '+the_node.data["$color"]); //returns #000000
console.log(the_node); //returns #111111 (should return #000000) (at data.$color)
}
A puzzling observation is that while the console displays correct values for 'before' and 'after' regarding the variable 'the_node.data.$color', indicating that the assignment has been successful, it does not reflect within the object 'the_node'.
Any insights on why this discrepancy might be occurring?
(below are the details of the contents of the object 'the_node' containing the 'data' object)
$$family: "class"
Config: {$extend: false, overridable: true, type: "multipie", color: "#e6e6e6", alpha: 1, …}
Edge: {$extend: false, overridable: false, type: "none", color: "#ccb", lineWidth: 1, …}
Label: {$extend: false, overridable: true, type: "Native", style: " ", size: 10, …}
Node: {$extend: false, overridable: true, type: "multipie", color: "#e6e6e6", alpha: 1, …}
_angularWidth: 1
_depth: 1
_flag: true
_treeAngularWidth: 3.1666666666666665
angleSpan: {begin: 0, end: 2.7762911822421428}
constructor: function()
data: Object
$alpha: "1"
$color: "#87b13e"
$dim-quotient: 1
$label-size: 15
$span: 2.7762911822421428
class: "trait"
color: "#000000"
trait: "endurance"
Object Prototype