Skip to content

Josh glantz - #1

Open
Jahteo wants to merge 11 commits into
masterfrom
josh-glantz
Open

Josh glantz#1
Jahteo wants to merge 11 commits into
masterfrom
josh-glantz

Conversation

@Jahteo

@Jahteo Jahteo commented Jul 15, 2020

Copy link
Copy Markdown
Owner

I finished the MVP on time, but spent too long working on the stretch, which is why I'm PR'ing & submitting late.
I'm going to submit & do a pull request as soon as I finish the MVP for now, to prevent a "late submission".
Stretch 1 is a work in progress, with my notes in it.

@christopherjbaker christopherjbaker left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pretty good! only a few mistakes. Several places with spacing irregularity, but you picked that up pretty quickly for CSS, so I think you will here too.

Comment thread index.js Outdated

//Task c: Convert string ("1999") to integer (1999) (no function required) // hint look up the Number method

console.log(parseInt("1999"));

@christopherjbaker christopherjbaker Jul 16, 2020

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is the correct way to do it. Good practice is to always include the radix (the base of the input number, in this case 10). console.log(parseInt("1999", 10)); (similarly, you can use this to parse hexadecimal (16) binary (8) etc).

The method they were looking for is console.log(Number("1999"));. Though this works, there are some reasons (constructors, which you haven't learned yet) why this is a potentially very confusing way.
There are other ways when performance is important, but no need to confuse the issue yet. =P

Comment thread index.js Outdated
console.log("I am " + ageInDogYears + " in dog years.");
}
ageConverter(32);
// returning undefined for some reason... grrr

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Because you didn't return anything. You logged it to the output but didn't return anything.

Comment thread index.js Outdated
feed = weight * .04;
} else if ( 10 < weight && weight <= 15 ) {
feed = weight * .03;
} else if ( weight < 15 ) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

double-check this

Comment thread index.js
}
console.log("Feed Me " + feed + " pounds of raw food a day");
}
dogFeeder(1, 15);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Other than the 1 error, this works. It could be easier to understand though, and there's some extraneous logic.

Comment thread index.js Outdated
}
console.log("Player " + result );
}
rockPaperScissors("spock");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

cheater

Comment thread index.js


// sytax expanded bc it was frying my brain...
// 99% sure there's a more elegant solution in here. Excited to find it later.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There is always a more elegant solution. There will usually be various trade-offs between them. Here, you've fully expanded the logic, which is much easier to follow manually but leaves more room for errors. Others might be shorter or more elegant or optimized, but be more difficult to understand easily.

Comment thread index.js Outdated
Comment thread index.js Outdated
}



Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Gettig there. Few bits missing.

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