Accept input, then output the result given a JS function