I am working on an app the returns a json table from a network request. When the user enters a 3 letter airport code and it gets returned in a newText object. If the type in the airport LAX the stateCode from the json file gets returned as CA but if the type in an airport code from a different country its returns an error because what has been returned doesnt have a stateCode. So i tried to use the “or” operator in the following code.
Local display.newText(myData.airports[1].stateCode or myData.airports[1].countryCode)
How can I return the stateCode and if it doenst have a stateCode, return the countryCode?