This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The expensive animation is causing performance issues. Write the function 'yourFunction' that reduces calls to the animation. | |
function scrollHandler() { | |
var items = document.querySelectorAll('.list-item'); | |
var i = 0; | |
var len = items.length; | |
for(; i < len; i++) { | |
// perform expensive animation | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
JavaScript Test | |
--------------- | |
A small script to open a popup when clicking a link. | |
Once you click on the button, clinking on it again will close the popup. | |
*/ | |
/* Task One - Improve this code |