-
-
Notifications
You must be signed in to change notification settings - Fork 240
London | 25-ITP-September | Carlos Abreu | Sprint 2 | Coursework #860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
London | 25-ITP-September | Carlos Abreu | Sprint 2 | Coursework #860
Conversation
…only for developers
…rameters and use Number function to convert into a Number
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
3 similar comments
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
1 similar comment
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
|
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
|
The text in the "Questions" section still appear in the PR description. |
|
@cjyuan |
|
Evening CJ Yuan Sorry for late reply. I don't get "HELLO___THERE" but "HELLO_THERE". That's my bad. Sorry! |
|
No need to apologise. It's a learning process. Can you figure out why your function is not working as expected and modify it accordingly so that it behaves what you expect? |
|
Hi @cjyuan Actually I change the function name from toUpperSnakeCase() to toUpperCamelCase() as stated by requirement. // This ensures consistent results even if the input has extra spaces. function toUpperCamelCase(str) { // Example usage: |
|
Can you explain why this code output And if you were to change it so that it returns would |
|
Q1: Can you explain why this code output A_B instead of A___B? A1: Because the regex /\s+/g replaces all consecutive spaces (no matter how many) with a single underscore. Q2: And if you were to change it so that it returns would A___B, how would you modify the code? A2: Making the output "A___B" As we want one underscore per space, we should replace each space individually, not as a group. We would change the function toUpperCamelCase(str) to look as bellow: function toUpperCamelCase(str) { console.log(toUpperCamelCase("A B")); // A___B Actually, /\s/g matches each single whitespace separately. |
|
Explanation is clear. All good. |

Learners, PR Template
Self checklist
Changelist
This PR is the commit I've done for Sprint 2 Coursework that needs to be merged into CYF main branch
Questions