Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////////////////////////////////////
- // Lecture 101: Arrays in es6/es2015
- const boxes = document.querySelectorAll('.box');
- //ES5
- /*
- var boxesArr5 = Array.prototype.slice.call(boxes);
- boxesArr5.forEach(function(cur) {
- cur.style.backgroundColor = 'dodgerblue';
- });
- */
- Array.from(boxes).forEach(cur => cur.style.backgroundColor = 'dodgerblue');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement