Skip to content

Instantly share code, notes, and snippets.

@AppMkrATL
Created February 13, 2018 14:46
Show Gist options
  • Save AppMkrATL/5d0ce09dd1e44a707052aa3744aeb033 to your computer and use it in GitHub Desktop.
Save AppMkrATL/5d0ce09dd1e44a707052aa3744aeb033 to your computer and use it in GitHub Desktop.
3_Text normalizer
function textNormalizer(text) {
// your code here
return (text.toLowerCase().trim());
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!
*/
// tests
function testTextNormalizer() {
const text = " let's GO SURFING NOW everyone is learning how ";
const expected = "let's go surfing now everyone is learning how";
if (textNormalizer(text) === expected) {
console.log('SUCCESS: `textNormalizer` is working');
} else {
console.log('FAILURE: `textNormalizer` is not working');
}
}
testTextNormalizer();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment