Lesson 25 of 55
javascriptJavaScript Performance – Profiling & Optimisation
11 mins
Course progress45%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 25 of 55
javascript11 mins
Keep these ideas in mind as you work through the lesson.
Key performance tips:
requestAnimationFrame for UI updates.performance.now() for high‑resolution timing.function debounce(fn, delay){
let id;
return (...args)=>{
clearTimeout(id);
id = setTimeout(()=>fn.apply(this,args), delay);
};
}
window.addEventListener('resize', debounce(()=>{
console.log('Resized', window.innerWidth);
},200));