I’m having trouble defining values in a way that I can call them later on.
If i define Search first, then Search.commands[3] is undefined.
If i define commandList first then commandList.commands[0] is undefined.
Is there a better way to define these objects such that the order doesn’t matter?
var Search = {
'str': 'search',
'param': 'search',
'action': '',
'commands': [
Category,
Location,
Sort,
commandList
]
}
var commandList = {
'commands': [
Search,
Category,
Stop
]
}
1 Answer