diff --git a/scratch/index.js b/scratch/index.js deleted file mode 100644 index cb315cd..0000000 --- a/scratch/index.js +++ /dev/null @@ -1,15 +0,0 @@ -const countCharacters = (text) => text.replace(/\n/g, '').length; -const countNewLines = (text) => text.match(/\n/g)?.length || 0; -const countTextStream = (textStream) => { - const numberOfCharacters = countCharacters(textStream); - const numberofNewLines = countNewLines(textStream); - return { numberOfCharacters, numberofNewLines }; -}; - -const main = () => { - const textStream = "A B C D E F G H I J K L M N O P Q \n\n R S T U V"; - const result = countTextStream(textStream); - console.log(result); -}; - -main(); \ No newline at end of file