Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function textNormalizer(text) {
- //
- return text.toLowerCase().trim();
- }
- // tests
- function testTextNormalizer() {
- var text = " let's GO SURFING NOW everyone is learning how ";
- var 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();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement