drupal javascript get arguments from url code example
Example: drupal 8 get argument from url
$current_path = substr(\Drupal::service('path.current')->getPath(), 1);
$path_args = explode('/', $current_path);
$current_path = substr(\Drupal::service('path.current')->getPath(), 1);
$path_args = explode('/', $current_path);