1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var aMatch = [];
var temp;
var wrap = {find: function() { }};
var targetPath = "x";
var o = {siteMap: {x: []}};
var n;
for (n = 0; n < 5; ++n) {
  // inside a for-loop
  if ( aMatch.length > 0 ){
      temp =  wrap.find( aMatch );                                
      break;
  } else if ( aMatch.length === 0 && o.siteMap[targetPath].length !== 0 ){
      temp = targetPath;
      break;
  }
}