feat: add logic

This commit is contained in:
afiqzudinhadi 2024-07-28 04:18:03 +08:00
parent a5bdff6fb9
commit 888243d07b

View file

@ -1,3 +1,16 @@
import { input } from '@inquirer/prompts';
const answer = await input({ message: 'Enter your name' });
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)
}
}