March 2017
Intermediate to advanced
442 pages
10h 44m
English
In the previous chapter, we started a project of creating a Naive Bayes Classifier (or NBC, for short). We’ve made improvements, but nothing so far really got to the heart of refactoring our functions and objects.
That’s what this chapter is all about.
In case you skimmed over the last chapter or missed a step somewhere, here is the version we ended up with:
functionfileName(){vartheError=newError("here I am");returntheError.stack.match(/\/(\w+\.js)\:/)[1];};console.log(`Welcome to${fileName()}!`);vareasy='easy';varmedium='medium';varhard='hard';imagine=['c','cmaj7','f','am','dm','g','e7'];somewhereOverTheRainbow=['c','em','f','g','am'];tooManyCooks=['c','g','f'];iWillFollowYouIntoTheDark ...
Read now
Unlock full access