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
806 B
806 B
id, title, challengeType, dashedName
| id | title | challengeType | dashedName |
|---|---|---|---|
| 661e151f068359c3ccf2f4d7 | Basic Functions Exercise C | 1 | top-basic-functions-exercise-c |
--description--
Write a function, named capitalize, that takes a string as an parameter and returns a new string with the first letter capitalized.
--hints--
You should have a function named capitalize.
assert.isFunction(capitalize);
Your function should take in a string as a parameter.
assert.match(capitalize.toString(), /\s*capitalize\(\s*\w+\s*\)/);
Your function should return a new string with the first letter capitalized.
assert.strictEqual(capitalize('sem'), 'Sem');
--seed--
--seed-contents--
--solutions--
function capitalize(str) {
return str[0].toUpperCase() + str.slice(1);
}