Advertisement
Guest User

Untitled

a guest
Sep 8th, 2019
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. ```javascript
  2. const a = 1;
  3. let b = 2;
  4. var c = 3;
  5.  
  6. console.log(window.a, window.b, window.c);
  7. ```
  8.  
  9. A) 1, 2, 3
  10. B) undefined, 2, 3
  11. C) undefined, undefined, 3
  12. D) undefined, undefined, undefined
  13.  
  14. ---
  15.  
  16. ```javascript
  17. let myArray = ['one', 'two', 'three', 'four', 'five'];
  18. myArray.fill('Peach');
  19.  
  20. console.log(myArray);
  21. // ["Peach", "Peach", "Peach", "Peach", "Peach"]
  22.  
  23. myArray.fill(7, 2);
  24.  
  25. console.log(myArray);
  26. // ["Peach", "Peach", 7, 7, 7]
  27.  
  28. myArray.fill('Onion', 2, 4);
  29.  
  30. console.log(myArray);
  31. // ["Peach", "Peach", "Onion", "Onion", 7]
  32.  
  33. myArray.fill('Apple', -4, -2);
  34.  
  35. console.log(myArray);
  36. // ["Peach", "Apple", "Apple", "Onion", 7]
  37. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement