Solution: lb_spellit

JavaScript·2 min read·Sep 19, 2025

Here is the commented solution for this project.

Create the script

Create a file named lb_spellit.js.

$ touch lb_spellit.js

Convert numbers up to hundreds

The objective of this part is to write a function that successively translates chunks of an integer in order from hundreds to tens, teens, and ones.

  1. Declare a function named numberToHundreds() that takes as parameter an integer.

    function numberToHundreds(number) {  //};
  2. Declare three arrays of strings corresponding to the textual form of ones, teens, and tens used to write digits and numbers from 1 to 99.

    function numberToHundreds(number) {  const ones = ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'];

Unlock the full program 🚀

Pay once, own it forever.

149

30-day money-back guarantee

  • 13 modules
  • 113 lessons with full-code examples
  • 29 projects with commented solutions
  • All future lesson and project updates
  • Lifetime access

By submitting this form, you agree to the Terms & Conditions and Privacy Policy.