const STATE = ["TEXAS","CALIFORNIA","FLORIDA","NEW YORK"]
const STATE_CODE = ["TX","CA","FL","NY"]
With two arrays provided, the first array is displayed in a dropdown menu. The challenge is to retrieve the corresponding state code from the second array once a state is selected from the dropdown.
What would be the approach to achieve this using AngularJS, JavaScript, and TypeScript?