-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
NW-6 | AREEB-SATTAR | JS1| [TECH ED] Complete week 2 exercises | WEEK-2 #149
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work Areeb. You've got the hang of function calls and a whole range of useful JavaScript syntax.
I've just left a few comments with some suggestions. There's an especially important comment in to-pounds.js
that talks about installing Prettier to follow CYF's coding guidelines.
week-2/implement/bmi.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The task needs a function that I can use to calculate a BMI that takes two arguments: weight and height.
This code does correctly calculate the BMI, but it would be even better if we could take that same function and use it elsewhere with any weight and height 🙂
week-2/implement/cases.js
Outdated
|
||
|
||
function snake_case (str){ | ||
return str.replaceAll(/ /g,'_').toUpperCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see you've had an introduction to RegEx, Areeb! It's an interesting technology to use, and can get incredibly complex (if you want an example, look up the RegEx required to check an email address!)
Because RegEx is so complex, I would recommend keeping this as simple as possible by using .replaceAll(' ', '_')
to just look out for space characters.
week-2/implement/to-pounds.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, that's a great function that can be re-used anywhere we need it!
I notice the indentation is slightly off inside the function. Not to worry, there's an easy fix that saves programmers a lot of time! Check out the CYF Docs to set up the Prettier extension in VS Code, and also allow Prettier to format the code every time you save the file
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
I have tried to answer all the questions and write some code
Questions
Ask any questions you have for your reviewer.
I had difficulty with starting sometime as it felt a lot of thinking without getting anywhere. What's the best way to approach the exercises so that it doesn't feel overwhelming?