I'm trying to multiply two components together in my object array
{
"rx": {
"vials": [
{
"description": "Rx 1",
"strength": 100,
"form": "ML",
"pkg_size": 10,
"case_size": 1,
"total_units": strength * pkg_size,
"ndc": "12345-1234-12",
"covered": true
}
]
}
}
But if I do something like
$( "#demo" ).html( rx.vials[0].total_units );
I get nothing or NaN
What am I doing wrong??
insulinkey in your objectrx.insulin.vials[0].total_unitswill throw an error if called on the object you provided!strengthandpkg_sizeare both undefined$( "#demo" ).html( rx.vials[0].total_units );I still don't get what I need.trength * pkg_sizecome from? If there is a problem it's in them!