[問題] jQuery each
// ARRAYS
var arr = [
'one',
'two',
'three',
'four',
'five'
];
$.each(arr, function (index, value) {
console.log(value);
// Will stop running after "three"
return (value !== 'three');
});
// Outputs: one two three
因為不懂jQuery 的 each方法所以去找了教學
看網路上的範例是這樣寫的
想請教的是,最後面的outputs
為何是 one two three
return (value !== 'three');
這是表示,假如值不是three的話就中止吧
那 one two 也不是 three啊
不是應該一開始就中止嗎??
還請各位高人們解惑~~謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.136.38.172
※ 文章網址: https://www.ptt.cc/bbs/Web_Design/M.1495902862.A.1B8.html
→
05/28 00:48, , 1F
05/28 00:48, 1F
推
05/28 01:06, , 2F
05/28 01:06, 2F
推
05/28 06:20, , 3F
05/28 06:20, 3F
→
05/28 06:20, , 4F
05/28 06:20, 4F
→
05/28 06:20, , 5F
05/28 06:20, 5F
→
05/28 22:07, , 6F
05/28 22:07, 6F
→
05/28 22:07, , 7F
05/28 22:07, 7F
→
05/28 22:07, , 8F
05/28 22:07, 8F
Web_Design 近期熱門文章
PTT數位生活區 即時熱門文章