Skip to content

Conversation

@sheriffderek
Copy link

I wrote this over again to see If I could remember. How does it look?

@sheriffderek sheriffderek changed the title Constructors and Prototypes - part 1 part1 - constructors and prototypes Dec 13, 2016
@sheriffderek sheriffderek changed the title part1 - constructors and prototypes Part1 - constructors and prototypes Dec 13, 2016
Copy link
Owner

@joshdmiller joshdmiller left a comment

Choose a reason for hiding this comment

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

The only thing I'd comment here is that this includes features not in the original test and that have no tests of their own. E.g. passing a parameter into the various speak functions.

src/index.js Outdated
// - I didn't understand what this was at first, but it's in the tests...
// - so, I have to give each constructor a 'constant' I guess...
// - "On the contrary... It is in uppercase because that's a common convention for constants defined on the constructor rather than on the prototype."
// - I still don't see the helpfulness of the all caps but I'm sure it's with reason to avoid some confusion
Copy link
Owner

Choose a reason for hiding this comment

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

The all caps is pure convention, probably a hold-over from an older language. If you look at languages like Java and C, constants are defined in all caps by convention. Even though these are not technically constants (JavaScript has no such feature), we list them in all caps to signify our intent.

@sheriffderek
Copy link
Author

So, this is without the added parameter being passed to speak. Seem good?

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