You don't need this iterator, exactly.
One way to go:

```js
var techs = ['NDEF', 'NDEF_FORMATTABLE', 'P2P'];
var priority = {
    'P2P': 0,
    'NDEF': 1,
    'NDEF_FORMATTABLE': 2,
    'NFC_A': 3,
    'MIFARE_ULTRALIGHT': 4
};

techs.sort(function sorter(techA, techB) {
    return priority[techA] - priority[techB];
});

alert(techs[0]);

switch (techs[0]) {
        
}
```