jQuery 跳出each循环

sunnylinner 2015-09-18

jquery跳出each循环,要实现break和continue的功能:

break用returnfalse;

continue用returnture;

jquery跳出each循环实例

var arr = [ "abc", "ef","gggg"];
$.each(arr, function(index, value){
  if (this == "abc")
    return false;
  }
);

相关推荐

Web全栈笔记 / 0评论 2020-06-15