Perform necessary alterations to the JavaScript before it is presented on the page.
$javascript: An array of all JavaScript being presented on the page.
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
function hook_js_alter(&$javascript) {
// Swap out jQuery to use an updated version of the library.
$javascript['misc/jquery.js']['data'] = drupal_get_path('module', 'jquery_update') . '/jquery.js';
}