Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@dabellator
Copy link

Hi James,

Here is my assignment. If I went off in the wrong direction at all, could you let me know and I'll redo it? I'm going to go through and add my questions on the lines they pertain to; looking forward to your input!

Thanks,
-JB

@dabellator dabellator force-pushed the master branch 2 times, most recently from 9184e07 to 02c3f98 Compare April 14, 2015 21:28
@dabellator
Copy link
Author

I saw your comment on someone else's assignment that the date object should be created when a method is called, and not when the module is first loaded. Based on that advice, I wrote it as a condition within getDate, but then I realized all the methods required a default so I changed it to a private function and called it in each method.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would just declare two arrays here as separate variables. It will clean up the date.days and date.months syntax which I agree seems a bit verbose. Figuring out when to use a configuration data object is more of a "what looks right" kind of decision. In the case of your days and months, it's clear from their context what they're for. If you have a lot of varied configuration data, having them on an object can help clarify that they're configuration data: config.interval, config.warning, etc.

@jamdon
Copy link
Contributor

jamdon commented Apr 17, 2015

Well done. 👍

@jamdon jamdon closed this Apr 17, 2015
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.