Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Core Tech
Labs

Create a String Manipulation Library in JavaScript

In this hands-on lab, you'll learn to refactor JavaScript modules related to the command-line interface of a library. You will refactor variable declarations and strings used for help and usage text. You'll also use JavaScript Symbols in the main module to provide globally unique values. By the end of the lab, you'll also have learned to use string interpolation and raw string processing.

Lab platform
Lab Info
Level
Beginner
Last updated
Jun 07, 2025
Duration
58m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Refactor variables imported with require

    In this module, we will refactor JavaScript modules related to the command-line interface of the library. This will involve refactoring variable declarations and strings used for help and usage text. By the end we'll use string interpolation and raw string processing. We'll also use JavaScript Symbols in the main module to provide globally unique values. ### Solution To view the solution, run git diff origin/master..module-2-solution in the Terminal, and press Enter to see the next lines of the difference.

    You may also browse the files of the solution by stashing your changes with git stash and running git checkout module-2-solution to switch branches.

  2. Challenge

    Create a template tag

    In this module, we'll implement custom template tags to allow consumers of our library to quickly transform text. These tags will also enable consumers to disable line transformations on a given class using a global symbol. By the end we'll demonstrate the use of several string methods by writing tests that ensure our template tags work as expected. ### Solution To view the solution, run git diff origin/master..module-3-solution in the Terminal, and press Enter to see the next lines of the difference.

    You may also browse the files of the solution by stashing your changes with git stash and running git checkout module-3-solution to switch branches.

About the author

AJ is a software developer who is passionate about technical education. He loves creating with code and volunteering with youth robotics programs.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight