Run ❯
Get your
own Node
server
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Go to Spaces
Ctrl+Alt+P
// @ts-check /** * @callback StringProcessor * @param {string} input * @returns {string} */ /** * @type {StringProcessor} */ const toUpperCase = (str) => str.toUpperCase(); /** * @param {string[]} strings * @param {StringProcessor} processor * @returns {string[]} */ function processStrings(strings, processor) { return strings.map(processor); } const result = processStrings(['hello', 'world'], toUpperCase); console.log(result.join(','));
Expected console output:
HELLO,WORLD