I'm trying to access elements of a javascript object. I have no control over how it has been created.
An example is as follows:
parameters = Object { checkout_method="guest", billing[firstname]="fasfdas", billing[lastname]="fdsa" }
this works fine -
var checkout = parameters.checkout_method;
however trying to access any of the billing ones results in either an error or an 'undefined'
var billing = parameters.billing['firstname'];
var billing = parameters['billing.firstname'];
basically I've crawled stackoverflow and tried about 20 different combinations to get the values with no result.
Does anyone have any idea how you access an object key with mixed square bracketed content?
var billing = parameters["billing[firstname]"];parameters.parameters["billing[firstname]"];work?