Skip to content

Instantly share code, notes, and snippets.

@Aupajo
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Aupajo/0a0f427dae54a7ad34ff to your computer and use it in GitHub Desktop.
Save Aupajo/0a0f427dae54a7ad34ff to your computer and use it in GitHub Desktop.
Woto application
var Candidacy = function(applicant) {
this.applicant = applicant;
};
Candidacy.SCORE_DIMENSIONS = [
'creativity',
'socialMediaEngagement',
'freshGraduate',
'passionate',
'workEthic'
];
Candidacy.prototype.score = function() {
Candidacy.SCORE_DIMENSIONS.reduce(function(total, dimension) {
return total += applicant[dimension];
}, 0);
throw new ArbitraryError("Really? Social media engagement?");
};
Candidacy.prototype.submitApplication = function() {
EmailService.deliver({
subject: "Applicant",
to: "apply@woto.com",
from: this.applicant.email,
body: this.applicant.introduction,
attachment: this.applicant.cvURL
});
};
// Reviewer's comments: Why are we bothering with this?
@fauxparse
Copy link

Warning: "applicant[dimension]" may be undefined, meaning total may end up NaN. The constructor should set default values for supported attributes.

@fauxparse
Copy link

Also, most "dimensions" are nouns, but "passionate" is an adjective. Suggest changing to "passion", with 0 as a possible value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment