Skip to content

Conversation

@Jess2896
Copy link
Owner

@Jess2896 Jess2896 commented Sep 25, 2019

Functionality

  • Calculates if Mark's BMI is higher than John's and prints the result on the console.

Verification steps

  • Download both files(index.html and script.js) into a folder and then open the index.html file on a browser.

  • Inspect the website and open the console to see the result obtained.

@Jess2896 Jess2896 changed the title BMI First challenge Sep 26, 2019
@oscarpolanco
Copy link
Collaborator

Hello @Jess2896
Nice description. Can you add how to run your code on the description?
What do you think about this?

@Jess2896
Copy link
Owner Author

Hello @Jess2896
Nice description. Can you add how to run your code on the description?
What do you think about this?

Added a verification process, let me know if its fine like this.

Copy link
Collaborator

@oscarpolanco oscarpolanco left a comment

Choose a reason for hiding this comment

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

We can add a few spaces on some of the lines in the code. Here a useful js guideline for js.

@Jess2896 Jess2896 force-pushed the first-challenge branch 5 times, most recently from ad3edc8 to 022cd34 Compare September 30, 2019 16:33
script.js Outdated
let isMarkHigherBMI = calculateBMI(markMass, markHeight) > calculateBMI(johnMass, johnHeight);

function calculateBMI(mass, height) {
return mass / (height * height);
Copy link
Collaborator

@oscarpolanco oscarpolanco Sep 30, 2019

Choose a reason for hiding this comment

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

On this line, you can add heigth^2 and is the same. What you think; can we update this?

Copy link
Owner Author

Choose a reason for hiding this comment

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

From what i gather ^ is the XOR bitwise operator and it gives a different result.

Copy link
Collaborator

@oscarpolanco oscarpolanco Oct 1, 2019

Choose a reason for hiding this comment

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

Should put it in words my bad 😅
There is an operator that is for the square. I put the mathematical notation. On js the operator is different

Copy link
Owner Author

Choose a reason for hiding this comment

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

Ah, I see what you mean. Fixed it.

Copy link
Collaborator

@oscarpolanco oscarpolanco left a comment

Choose a reason for hiding this comment

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

Good job!! Just a minor comment for fun

script.js Outdated
let isMarkHigherBMI = calculateBMI(markMass, markHeight) > calculateBMI(johnMass, johnHeight);

function calculateBMI(mass, height) {
return mass / (height * height);
Copy link
Collaborator

@oscarpolanco oscarpolanco Oct 1, 2019

Choose a reason for hiding this comment

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

Should put it in words my bad 😅
There is an operator that is for the square. I put the mathematical notation. On js the operator is different

index.html Outdated
</body>
</html>

<script src='script.js'></script>
Copy link

Choose a reason for hiding this comment

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

script tags are included inside the body tag.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Fixed.

script.js Outdated
@@ -0,0 +1,11 @@
let markMass = 70;
Copy link

Choose a reason for hiding this comment

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

Why using let here?

Copy link
Owner Author

Choose a reason for hiding this comment

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

My bad, realized i should have been using const on the second challenge and fixed the declarations in all the PRs except for this one.

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.

4 participants