Essential JavaScript

Name Length Kata

You are a teacher of a very large class of students.

Your students are competitive. They turn everything into a game (or an argument, really).

Their latest competition is about who has the longest name. They have at least agreed to count every letter of each student's first, middle, and last name.

You open your gradebook online and are reminded that you have many, many students. Instead of counting each name individually, you decide to write some code to do it for you.

Given the first, middle, and last name of a student, return the total number of characters in that student's name. Do not add or count spaces between names.

For example, a student with the names John Jacob Smith would have a total name length of 14.

Code Editor