Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

areebsattar
Copy link
Contributor

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

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?

Copy link
Member

@JayMayer JayMayer left a 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.

Copy link
Member

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 🙂



function snake_case (str){
return str.replaceAll(/ /g,'_').toUpperCase();
Copy link
Member

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.

Copy link
Member

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

week-2/interpret/time-format.js Outdated Show resolved Hide resolved
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.

2 participants