how to return values from function.

how to return values from function.

the code below checks an array of objects for a name in one of the objects and if found it returns the index number if not returns false, but im having troubles. 
1. what is the correct way to skip to the next iteration of the .each loop
2 what is the correct way  exit the function 

  1. this.nameExists =function(attributeNodeClass){
  2. $.each(list, function(i,anc){
  3. if(attributeNodeClass.name==anc.name){
  4. return i;
  5. }else{
  6. }
  7. });
  8. return false;
  9. }//END this.exists =function()