Advertisement
maymunskoa

True For Just One (7kyu)

Mar 27th, 2020
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function one(arr, fun) {
  2.   let result = arr.filter(item => {
  3.     return fun(item) === true;
  4.   });
  5.   return result.length === 1 ? true : false;
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement