thecodezone.
The Code Zone
Short steps, at your pace · Free lessons and practice · Member video walkthroughs
Save your next small win.

Checking your account…

YOUR SAVED CODE-ALONG

Find a longest word with Rob: workspace

Keep the lesson open on your other screen. Your edits stay in this workspace, separate from the practice activity. Sign in to save and reload a private account draft across devices, or share a snapshot when you need help.

Open Theater ModePop Out Code Editor (opens a separate window when supported)Go to editor Join Our Coding Skool$7/m · 7 Day Free Trial in The Code Zone on Skool (opens in a new tab)Watch the video & read the lesson (opens in a new tab)Ask a question in The Code Zone (opens in a new tab)

CODE-ALONG / THEATER MODE

Find a longest word with Rob

ORIGINAL WALKTHROUGH · 12:43

Watch with Rob.

Pause whenever you want to try a change. You can return to the lesson at any time.

LEARN WITH THE CODE ZONE

Unlock this video walkthrough

Written lessons and coding practice are free. Video walkthroughs are included with a paid Code Zone membership or an active free trial.

Have a Code Zone website account? Use your learning account’s email to get a six-digit sign-in code, or use your existing website password.

Need a website account? Paid Skool members and active trial members can use the email from their membership questions to request a sign-in code. No invite link or Skool password needed.

Close this window to keep practicing. After signing in, you’ll return to this lesson.

Video walkthroughs are included with an active Code Zone membership. The written lesson and practice are free.

Video settings & progress

Your lesson progress

Reading & walkthrough: not started

Empty: not started. Yellow: in progress. Green: complete. Marking the whole activity complete does not replace your test results. These circles save in this browser for this pilot.

Start the video to enable typing controls.

YOUR TURN

Find a longest word with Rob: workspace

Write largestWord(str), returning the longest word in a string. If several words have the same greatest length, return the first. Start with I am a coding ninja, which should return coding. Also try red sun, which should return red. For this companion, split on spaces, keep punctuation in tokens and use basic Latin text. This separate code-along is exploratory; use the companion practice for graded output checks.

Load an example, edit it and run it. Word wrap is enabled.

Work in VS Code instead

Copy the starter into a file named practice.js in VS Code. If Node.js is installed, open the terminal in that folder and run node practice.js. Compare the output with the task above. Automated challenge checks are available in the browser editor.

Code example
example.jsjavascript · example
/*
Write largestWord(str), returning the longest word in a string. If several words have the same greatest length, return the first. Start with I am a coding ninja, which should return coding. Also try red sun, which should return red. For this companion, split on spaces, keep punctuation in tokens and use basic Latin text.
*/

function largestWord(str) {
  let largest = "";
  // Split the phrase and update your candidate here.
  return largest;
}

// Log largestWord("I am a coding ninja") when ready.

Replace your editor code?

Your current work will be replaced. Choose Cancel to keep it.

See the attached lesson’s comicRob compares coding with six letters to ninja with five and selects coding from I am a coding ninja.