- In the context of Node, what is a
module
?- A chunk of code that can be shared (required) between files, much like classes and modules can be shared between files in Ruby. There is no syntax required when creating what may become a module. Instead, use of
module.exports
at the end of a file determines what code is available when usingvar access = require('path/to/file')
in another file that may need it.
- A chunk of code that can be shared (required) between files, much like classes and modules can be shared between files in Ruby. There is no syntax required when creating what may become a module. Instead, use of
- The code examples from the second blog post look very different from the first. Why?
- The first is using the syntax from node to export modules, whereas the second is using a file and module loader called RequireJS.
My code: here
- Responder #1 (here) - This individual took a similar approach, though they did not utilize a ternary. Additionally, they used an interesting check with the modulo to ensure that the remainder for the
year / 100
was greater than 0, and not equal to 0. I assume this was done in place of ensuring that it was not cleanly divisible by 100, but I found it to be a less readable implementation. - Responder #2 (here) - This individual's approach was verbose with regard to usage of
return
statements for true or false, but, as a result, it was easy to follow their thought process. I was intrigued to see usage of anif
statement after anelse if
. It indicated a level of flexibility within JavaScript syntax that I wouldn't have expected. - Responder #3 ([here](http://exercism.io/submissions/
- What is
ES6
?
- Officially ECMAScript 6, it is the most recent build of syntax for JavaScript (ECMAScript is the 'proper' name for JavaScript).
- What is Transpilation and how does it relate to
ES6
?
- A source-to-source compiler. With regard to
ES6
, a tool like Babel would allow you to write inES6
and have the code compiled toES5
, for environments whereES6
might not yet be supported.
- Looking at the ES6 features link below, discuss one update from
ES5
and if it seems useful/superfluous.
- I had seen the new 'arrow' syntax but didn't have an understanding of it. In short, it is shorthand for
function
and is of particular use when a single-line function is being called. From the examples found here:
var bar = foo.map(function(x) { return x.length; });
becomes:
- Load/Reload waffle.
- Get most current list of actions for the project.
- Choose a card from the backlog in waffle. If we're working separately, it's best to move that card that you've chosen into ready and perhaps assign it to yourself as well.
- Make sure multiple team members aren't working on the same issue; ensure everyone knows what each other is working on.
- git checkout master
- git pull origin master
- Ensure you're starting on the master branch and have the most recent changes pulled down.
- run rspec
- Make sure there are no outstanding issues with code on master.
- First let's read MDN HOW WEB WORKS.
- Next let's watch a few quick examples of how the internet works.
- And [how IP addresses work](https://www.youtube.com/watch?v=KFooN7Mu0IM - how IP addresses work).
- Finally let's tie these things together and watch a video about DNS - what happens when you type an address into a web browser.
This exercise is intended to help you assess your progress with the concepts and techniques we've covered during the week.
For these questions, write a short snippet of code that meets
the requirement. In cases where the question mentions a "given"
data value, use the variable given
to refer to it (instead of re-writing
the information).