The JavaScript sample code for REST (Located here...) contains a nifty little JavaScript API library (spokes.js) that can be reused by other JavaScript apps.
To help show the features "spokes.js" has been run through JSDoc to make an API reference. Please find the download link below.
It looks like this: