Skip to content

Commit

Permalink
Replace for loop by forEach
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Garnier authored and addyosmani committed Jul 8, 2015
1 parent 0e57355 commit 4d26caa
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docs/_assets/codepen.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ CodeBlockCodePen.prototype.MDLIBS = [
CodeBlockCodePen.prototype.init = function() {
'use strict';

for (var i = 0, len = this.codepenButtons.length; i < len; i++) {
var form = this.codepenButtons[i];
[].slice.call(this.codepenButtons).forEach(function(form) {
var pre = form.parentNode;

// Attach the click event to the codepen button.
form.addEventListener('click', this.clickHandler(form, pre));
}
}, this);
};

/**
Expand Down

0 comments on commit 4d26caa

Please sign in to comment.