Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. ////////////////////////////////////////
  2. // Lecture 101: Arrays in es6/es2015
  3.  
  4. const boxes = document.querySelectorAll('.box');
  5.  
  6. //ES5
  7. /*
  8. var boxesArr5 = Array.prototype.slice.call(boxes);
  9. boxesArr5.forEach(function(cur) {
  10. cur.style.backgroundColor = 'dodgerblue';
  11. });
  12. */
  13. Array.from(boxes).forEach(cur => cur.style.backgroundColor = 'dodgerblue');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement