Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
関数を持つアンダースコアのミックスインがあります。こことここで見るtakeWhileことができます(私はこれを使用しています)。
takeWhile
これをどのように使用しますか?
takeWhile: function(list, callback, context)
あなたはそれをそのように使用します...
var newArr = _.takeWhile([1, 2, 3, 2, 1], function(elem) { return elem < 3; }); // [1, 2]
JSビン。