Skip to content

Conversation

@pallavisarwar
Copy link
Collaborator

No description provided.

@pallavisarwar pallavisarwar requested a review from dannyelcf May 6, 2024 13:25
@pallavisarwar pallavisarwar self-assigned this May 6, 2024
Comment on lines +4 to 7
document.getElementById(CAP_SWAP_BUTTON).addEventListener('click', () => {
// read & process user input
let userInput = null;
while (userInput === null) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove these lines once you already import './listener';

Comment on lines 12 to 24
const capSwapped = userInput
.split('')
.map((str) => {
const charCode = str.charCodeAt(0);
if (64 < charCode && charCode < 91) {
return String.fromCharCode(charCode + 32);
} else if (96 < charCode && charCode < 123) {
return String.fromCharCode(charCode - 32);
} else {
return str;
}
})
.join('');
Copy link
Owner

@dannyelcf dannyelcf May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You must invoke capSwap function here once you implemented it in the util.js

Ex:

const capSwapped = capSwap(userInput)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants