Advertisement
Guest User

Untitled

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