Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width">
- <title>Text Normalizer</title>
- </head>
- <body>
- <script id="jsbin-javascript">
- function textNormalizer(text) {
- return text.toLowerCase().trim();
- }
- 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();
- </script>
- <script id="jsbin-source-javascript" type="text/javascript">function textNormalizer(text) {
- return text.toLowerCase().trim();
- }
- 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();</script></body>
- </html>
Add Comment
Please, Sign In to add comment