代码拉取完成,页面将自动刷新
array
.
import baseWhile from './.internal/baseWhile.js'
/**
* Creates a slice of `array` with elements taken from the end. Elements are
* taken until `predicate` returns falsey. The predicate is invoked with
* three arguments: (value, index, array).
*
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* const users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': true },
* { 'user': 'pebbles', 'active': true }
* ]
*
* takeRightWhile(users, ({ active }) => active)
* // => objects for ['fred', 'pebbles']
*/
function takeRightWhile(array, predicate) {
return (array != null && array.length)
? baseWhile(array, predicate, false, true)
: []
}
export default takeRightWhile
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。