The brief
you can't edit the code — only instruct the AIinitials(name)
- Returns the initials of
namein uppercase. - Only the first and last words count — middle names are ignored.
- A single-word name is returned unchanged. Whitespace may be messy.
initials("ada lovelace") → "AL"
current code — written by the AI
function initials(name) {
// Turn a full name into initials.
return name.split(" ").map(w => w[0].toUpperCase()).join("");
}
6 hidden cases · 1 shown
Drive the AI
it does exactly what you sayDrive me to fix initials so it passes the hidden tests. I do exactly what you tell me — nothing more — so be precise. Every message costs tokens; fewest tokens wins. Par is 450. Hit “Run tests” whenever you want to check.
token spend vs par0 / 450