public AssetResolverInterface::getJsAssets(AttachedAssetsInterface $assets, $optimize)
Returns the JavaScript assets for the current response's libraries.
References to JavaScript files are placed in a certain order: first, all 'core' files, then all 'module' and finally all 'theme' JavaScript files are added to the page. Then, all settings are output, followed by 'inline' JavaScript code. If running update.php, all preprocessing is disabled.
Note that hook_js_alter(&$javascript) is called