Files
wehub-resource-sync dde272c4b8
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 11:55:53 +08:00

1.5 KiB

id, title, challengeType, dashedName
id title challengeType dashedName
6a1d9f98e819ed70a0e994dc Challenge 330: lowercase words 28 challenge-330

--description--

Given a string, return only the words that are entirely lowercase, in their original order and with a space between each word.

--hints--

getLowercaseWords("hello GOOD world") should return "hello world".

assert.equal(getLowercaseWords("hello GOOD world"), "hello world");

getLowercaseWords("these are all lowercase") should return "these are all lowercase".

assert.equal(getLowercaseWords("these are all lowercase"), "these are all lowercase");

getLowercaseWords("less is NoT more") should return "less is more".

assert.equal(getLowercaseWords("less is NoT more"), "less is more");

getLowercaseWords("DonT eat pizza every OTHER day") should return "eat pizza every day".

assert.equal(getLowercaseWords("DonT eat pizza every OTHER day"), "eat pizza every day");

getLowercaseWords("the Super quick AND snEaky brown fox Leapt anD jumped over aNd AROUND the lazy SloW dog") should return "the quick brown fox jumped over the lazy dog".

assert.equal(getLowercaseWords("the Super quick AND snEaky brown fox Leapt anD jumped over aNd AROUND the lazy SloW dog"), "the quick brown fox jumped over the lazy dog");

--seed--

--seed-contents--

function getLowercaseWords(str) {

  return str;
}

--solutions--

function getLowercaseWords(str) {
  return str.split(" ").filter(word => word === word.toLowerCase()).join(" ");
}