馃殌 CYBER WEEK SALE: 50% OFF on JavaScript Fundamentals 馃挭

Task #1093 - Resolve and reject

Function getUser accepts userId and returns a Promise. The functionality is missing and you need to fix that. The promise should be rejected if the userId is missing. The promise should be resolved with the appropriate user object if the userId is provided....

August 15, 2020 路 1 min 路 Coderslang Master

Task #110 - Fruits

Fill in the array fruits with 5 elements and export it from the file helper.js 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...

August 15, 2020 路 1 min 路 Coderslang Master

Task #1108, Stage #1 - Funky console

Programming should be fun! In this task, you鈥檒l learn how to add a randomized delay to the console.log statements in JavaScript and Node.js. We鈥檒l start small. In the file function.js you see an empty function log....

August 15, 2020 路 1 min 路 Coderslang Master

Task #1108, Stage #2 - Funky console

Now, we鈥檒l split the output into individual characters. Each character should be printed separately using console.log Also, let鈥檚 refactor the code and rename our function to splitLog This task is part of the Full-Stack JavaScript Course....

August 15, 2020 路 1 min 路 Coderslang Master

Task #1108, Stage #3 - Funky console

The problem is that now each character is printed on a separate line. We can fix this by replacing console.log with process.stdout.write. As we still want the output to end with a newline character, print \n...

August 15, 2020 路 1 min 路 Coderslang Master

Task #1108, Stage #4 - Funky console

Great job! Now we鈥檒l start working on a delay. Implement a sleep function and export it from the file helper.js Here鈥檚 the spec: sleep should return a Promise the Promise returned by sleep(ms) should be resolved in ms milliseconds This task is part of the Full-Stack JavaScript Course....

August 15, 2020 路 1 min 路 Coderslang Master

Task #1108, Stage #5 - Funky console

Let鈥檚 use the sleep function that you鈥檝e just implemented. add a second parameter delay to the function writeLog sleep for delay milliseconds after printing each character don鈥檛 forget the async and `await keywords!...

August 15, 2020 路 1 min 路 Coderslang Master

Task #1108, Stage #6 - Funky console

The output will look even better if we randomize the timing. Let鈥檚 add another boolean parameter randomized to the function writeLog. If it鈥檚 true, then the argument passed into sleep...

August 15, 2020 路 1 min 路 Coderslang Master

Task #1108, Stage #7 - Funky console

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

August 15, 2020 路 1 min 路 Coderslang Master

Task #1108, Stage #8 - Funky console

You did a great job! One more thing and we鈥檒l be good to go Let鈥檚 add a default delay of 100ms to the funkylog. So, if the field delay is missing from the config object, we set it to the default value....

August 15, 2020 路 1 min 路 Coderslang Master