Skip to Content
The Refactor Factory
Omit Needless Words

One of the most common suggestions when it comes to writing is to omit needless words, and it applies just as much to writing Ruby as writing stories.

There are two control structures to change here:

  1. The unless on line 6
  2. The if on line 10



Refactor the code in the editor to use single-line ifs and unlesss.

Folder Icon

Take this course for free

Already have an account?