This is probably a simple answer but i am still learning so here i go. I have an object shade which you can see below. I also have a html value element which i am trying to split the value and place it into my object.
However its trying to add to shade.color.fill which doesnt exitst i need it to add to shade.color.cord instead.
value="type|Color"
Javascript
var obj = {
color: {
Type: null
}
}
var fill = this.getAttribute('value').split("|");
shade.color.fill[0] = fill[1];
console.log(obj.type.color);
error:
TypeError: obj.type.fill is undefined
fill[0] = cordso your value will assign toshade.color.cordand you are accessingshade.color.fillwhich will give youundefinedas errorshade.color.fill = [fill[1]];