Skip to content

Instantly share code, notes, and snippets.

@danawoodman
Created April 8, 2015 04:17
Show Gist options
  • Save danawoodman/c6031d913dcf901a5a43 to your computer and use it in GitHub Desktop.
Save danawoodman/c6031d913dcf901a5a43 to your computer and use it in GitHub Desktop.
JavaScript Cheat Sheet

JavaScript Cheat Sheet

This is intended as a grab bag of tips, shortcuts, reference and otherwise useful information related to JavaScript (and Node.js).

Language Features

bind

Bind is a very useful tool for changing the scope of this within functions as well as passing in parameters:

function log(msg) {
  console.log(msg);
}

var logger = log.bind(this, 'Hello World');
logger(); //=> 'Hello World'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment