I am trying to use underscore in my WordPress Admin. This is what I have done: I enqueue a script in the very end of the page, like so:
function load_admin_scripts() {
wp_enqueue_script( "my-admin", get_template_directory_uri() . "/assets/scripts/admin.js", array('jquery', 'wp-util'), null, true );
}
add_action('admin_enqueue_scripts', 'load_admin_scripts');
…then in the script file, I am at the moment only trying this:
console.log( jQuery ); // is defined
console.log( underscore ); // ReferenceError: underscore is not defined(…)
Can anyone point me to the solution for this?