3 lines
136 B
JavaScript
3 lines
136 B
JavaScript
const takeRightWhile = (arr, func) => arr.reduceRight((acc, el) => func(el) ? acc : [el, ...acc], []);
|
|
module.exports = takeRightWhile;
|