Reverse and Omit Non-alphabetic Characters

In this example below you will see how to do a Reverse and Omit Non-alphabetic Characters with some HTML / CSS and Javascript

Given a string (str), this function omits all non-alphabetic characters while reversing all other characters.

This awesome code was written by izotope115, you can see more from this user in the personal repository.
You can find the original code on
Copyright izotope115 ©
  • HTML
  • CSS
  • JavaScript

/*Downloaded from */

/*Downloaded from */
    const reverseLetter = str => {
  let replace = str.replace(/[0-9]/g, "").replace(/[^a-zA-Z0-9]/g, "");
  replace = replace.split("").reverse().join("");

  return replace;

// reverseLetter("ultr53o?n"); "nortlu"
// using 'let' vs const becase we are re-assigning its value