When passing a variable from a render array to JavaScript how do you reach that variable in your Javascript I add a variable in the backend to a render array like so (removed superfluous code):
$some_var = 'Hello World';
return [
  '#attached' =&gt; [
    'drupalSettings' =&gt; ['someVar' =&gt; $some_var],
  ],
  '#theme' =&gt; 'core_portal_customer_subscription_edit',
  '#data' =&gt; [
    'namespace_something' =&gt; $some_var,
  ]
];

I would then like to use that variable in my JavaScript but I can't seem to access the drupalSettings.
I tried doing the following but that console.logs undefined.
(function($, Druapl, drupalSettings) {
  Drupal.behaviors.escrowPortalCore = {
    ...
    console.log(druaplSettings.someVar);
  }
}());
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));