Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const printLove = (name) => {
- let result = 'Con amor ' + name;
- return result;
- }
- const limitFunction = (cb, n) => {
- return (...args) => {
- if(n > 0){
- n--;
- return cb(...args);
- }
- return null
- }
- }
- const sayLove = limitFunction(printLove, 2);
- console.log(sayLove('german'));
- console.log(sayLove('german'));
Add Comment
Please, Sign In to add comment