diff --git a/index.js b/index.js index 3099947..a5a8965 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,16 @@ import { input } from '@inquirer/prompts'; -const answer = await input({ message: 'Enter your name' }); \ No newline at end of file +const answer = await input({ message: 'Enter your string:' }); + +const words = answer.split(' ') + +for (let i = 0; i < words.length; i++) { + if (words[i][0] !== words[i][0].toUpperCase()) { + console.log(false) + break + } + + if (i === words.length - 1) { + console.log(true) + } +} \ No newline at end of file