Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Task 1: Iterate over the array below and if the current number is divisible by 3, print 'Fizz', if its
- // divisible by 5, print 'Buzz', if it is divisible by both 3 and 5, print 'FizzBuzz'
- const fizzBuzzArray = [1, 2, 3, 4, 5, 7, 8, 13, 15];
- // Task 2: Generate the first 10 fibonacci numbers
- // Task 3: Generate the first 15 fibonacci numbers, then filter only the even numbers and transform them
- // into an objects that have `number` property - { number: 1 }
- // HOMEWORK: Implement map, filter and reduce
- // Task 4: If you have the function `add`, your task is to create the behavior that whenever the function
- // is invoked, to not only execute it, but log the times that function was called, without
- // changing the `add` function directly
- const add = (a, b) => a + b;
- // Task 5: If you have the function `add`, your task is to create the behavior that when the function
- // is called the first time with certain parameters and return a certain value, to store the
- // parameters and the return value and if the function is called again with the same parameters
- // to immediately return the stored return value, without invoking the function again
- // HOMEWORK: Implement 5 examples of closure
- // Task 6: Use promises to resolve the number `5` after 1 second and log it in the console
- // Task 7: Use async-await to reproduce the same behaviour
- // Task 8: Use async-await to get 2 numbers asynchronously, sum their value when they come
- // and return it as a result from the async function
- // HOMEWORK: Implement 5 examples for asynchronous programming
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement