Skip to content
intermediate

Pin it down: the cases that make a slug unambiguous

Implement this from the stub. Hidden tests grade the behaviour you write, not the comments you leave.

Ask for "a function that turns a title into a URL slug" and you will get something back that works on `Hello World`. It will also do something with ` C++: A Guide! `, and what it does is a decision somebody made without telling you.

export interface Case {
  input: string
  expected: string
}

/**
 * The cases that pin the description down.
 *
 * To pass, this list must accept the correct implementation and reject each of
 * the five wrong ones. A case whose `expected` is not what the description
 * requires will fail against the correct implementation, so getting the values
 * right is part of the exercise.
 */
export const CASES: Case[] = [
  // Your cases here
]
challenge — implement from scratchCtrl+↵ submits · Ctrl+Shift+↵ runsstarter code