Skip to content

Instantly share code, notes, and snippets.

@jaySmilet
Created October 8, 2025 17:58
Show Gist options
  • Select an option

  • Save jaySmilet/feb04a60ae445b25f383423db4e0f519 to your computer and use it in GitHub Desktop.

Select an option

Save jaySmilet/feb04a60ae445b25f383423db4e0f519 to your computer and use it in GitHub Desktop.
Call Apply Bind Alternative
// Using spread instead of apply
let args = [1, 2, 3];
someFunc(...args); // No need for apply!
// Arrow functions for keeping 'this'
const buttons = document.querySelectorAll('.btn');
buttons.forEach(btn => btn.addEventListener('click', () => handleClick()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment