JSFiddle - React, Tailwind, and code Playground
JavaScript
// write a function called `partial` that uses the `add` function and makes the following snippet work
function add( a, b ) {
return a + b;
}
// add function here
function partial(cb, num) {
result = (val) => val + num
return result
}
// this should work
var add5 = partial( add, 5 );
console.log(add5( 4 )); // 9
add5( 3 ); // 8