I'm looking for an elegant way to override values in an associative array.
For example, say I have my base options as:
var base_options = {
hintText:"something",
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
width: 200, height: LABEL_HEIGHT-4,
font: {fontSize:16}, left: 95
}
I want to use this as the base, but be able to override a few items in this base on a case-by-case basis - for example, hintText would be different for each item. What's a clean and elegant way to get a copy of this array with a few parameters modified?
I realize I can change each individual item, as in:
options.hintText = "new thing";
but I suspect there's a more elegant way.