Archived tutorial

This tutorial is archived and won't be updated. We're keeping it online for now as a courtesy.

Underscore.js in a Theme or Module for Drupal 8, Drupal 9

Last updated March 15, 2021
Theming8.9.x/9.4.x

Underscore.js is a very small library which provides several utility functions and helpers to make working with JavaScript a little bit easier. In this tutorial we'll take a look at a part of the library, learn where the full library is documented, and see how we can make use of Underscore.js in a custom block on our Drupal site.