JAVASCRIPT Telegram 2627
CHALLENGE

const createLogger = (prefix) => (message) => `${prefix}: ${message}`;
const createCounter = () => {
let count = 0;
return () => ++count;
};

const withLogging = (fn) => (...args) => {
const result = fn(...args);
console.log(`Called with: ${args}, Result: ${result}`);
return result;
};

const counter = createCounter();
const loggedCounter = withLogging(counter);
const logger = createLogger('INFO');

console.log(loggedCounter());
console.log(logger(loggedCounter()));
👍62



tgoop.com/javascript/2627
Create:
Last Update:

CHALLENGE

const createLogger = (prefix) => (message) => `${prefix}: ${message}`;
const createCounter = () => {
let count = 0;
return () => ++count;
};

const withLogging = (fn) => (...args) => {
const result = fn(...args);
console.log(`Called with: ${args}, Result: ${result}`);
return result;
};

const counter = createCounter();
const loggedCounter = withLogging(counter);
const logger = createLogger('INFO');

console.log(loggedCounter());
console.log(logger(loggedCounter()));

BY JavaScript


Share with your friend now:
tgoop.com/javascript/2627

View MORE
Open in Telegram


Telegram News

Date: |

Telegram channels fall into two types: It’s easy to create a Telegram channel via desktop app or mobile app (for Android and iOS): Add the logo from your device. Adjust the visible area of your image. Congratulations! Now your Telegram channel has a face Click “Save”.! The main design elements of your Telegram channel include a name, bio (brief description), and avatar. Your bio should be: The creator of the channel becomes its administrator by default. If you need help managing your channel, you can add more administrators from your subscriber base. You can provide each admin with limited or full rights to manage the channel. For example, you can allow an administrator to publish and edit content while withholding the right to add new subscribers.
from us


Telegram JavaScript
FROM American