Right now, we’ve implemented pretty much everything we wanted to.
But calling it isn’t very clean as we have to pass the delay
and randomization flag every time we want to print something to the console.

writeLog('Hello, world!', 100, true);

It’d be nice if we could have a configurable log
that could be called with a single parameter - a string that we want to output.
To do this, we’ll have to rewrite our code. Here’s the plan:

  • wrap all current functionality into a single function funkylog
  • funkylog should accept an object with 2 fields: delay and randomized
  • funkylog should return the anonymous arrow function, which accepts a string as a parameter and then calls writeLog with this string

Here’s how it will be used:
const log = funkylog({ delay: 100, randomized: true });
log('Hello, world!');

This task is part of the Full-Stack JavaScript Course .
If you have any issues with it, you can ask for community help below the post.
Feel free to help others if you’ve already solved the task.