API is returning me a value I need to assign to a certain property in my object.
However, when I try to assign this valuee to my object, I get an error:
Error Getting Data
Arguments[1]
0: ReferenceError
message: "p_r is not defined"
stack: (...)
get stack: function () { [native code] }
set stack: function () { [native code] }
__proto__: Error
callee: function (err){
length: 1
__proto__: Object
The code where I try to assign this variable looks like this:
var AB = { pName:"AB", p_r:70, p_r_OK:80, logoURL:"../images/AB512.png" };
AB[p_r] = response[0].result;
AB object has been declared before together with p_r property. Where am I making a mistake?