![Zyxware default image3](/sites/default/files/2021-10/Artboard%202%20copy%2014.png)
drupal_add_js() function is mainly used to add JavaScript to the page, either as reference to an existing file or as in-line code (by writing the code directly in the page). But it also add settings to Drupal's global storage of JavaScript settings. These settings can access using Drupal.settings variable in JavaScript file.