Skip to content

Instantly share code, notes, and snippets.

View junkafarian's full-sized avatar

Fergus Doyle junkafarian

View GitHub Profile
// 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
}
/*
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