Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Correct Sentence solution in Uncategorized category for Correct Sentence by vvm70
import assert from "assert";
function correctSentence(text: string): string {
return text[0].toUpperCase() + text.slice(1).replace('.', '') + '.';
}
console.log('Example:');
console.log(correctSentence('greetings, friends'));
// These "asserts" are used for self-checking
assert.equal(correctSentence('greetings, friends'), 'Greetings, friends.');
assert.equal(correctSentence('Greetings, friends'), 'Greetings, friends.');
assert.equal(correctSentence('Greetings, friends.'), 'Greetings, friends.');
console.log("Coding complete? Click 'Check' to earn cool rewards!");
June 2, 2020