Drupal 8 Add Javascript What is the best way to add javascript to Drupal theme now that drupal_add_js is gone?

I want to use specifically jQuery ui animate, which I suspect is in Core, but I cant find out how to add it to my theme.
Use the following function in template.php of your theme.     

function MYTHEME_preprocess_page(&amp;$vars, $hook) {
  $path = drupal_get_path('theme', 'MYTHEME');
     // Render the main scripts file.
  $local_js = array(
    '#attached' =&gt; array(
      'js' =&gt; array(
        $path . '/js/scripts.js' =&gt; array(
          'group' =&gt; JS_THEME,
          'weight' =&gt; 9999),
      ),
    ),
  );
  \Drupal::service('renderer')-&gt;renderRoot($local_js);
}