When passing a variable from a render array to JavaScript how do you reach that variable in your Javascript
When you need to use a variable in the JavaScript you have set from the backend and added to the drupalSettings, you can access that variable using the drupalSettings object like tried in the example code from the question but then without adding drupalSettings to the js function, like so:
(function($, Drupal, drupalSettings) {
  Drupal.behaviors.portalCore = {
    ...
    console.log(druaplSettings.someVar); // &quot;Hello World&quot;
  }
}(jQuery, Drupal, drupalSettings));