In this lesson, you will learn the difference between the exports statement and module.exports. Two examples are demonstrated, each accomplishing the same task but one using export statements and one using module.exports. You will also learn the basic thumb rule to identify which is appropriate for your current needs.
To be concise you can pass in the parameter var circle = require('./circle')(4)
rather than declaring a myCircle
True! Thanks for the input!
For Korean engineers, I found a useful info about this lecture. (written in Korean) http://programmingsummaries.tistory.com/340
Thanks for the great course!
I believe there's a typo in the code snippet companion for the video (not in the code of the video itself) with PI versus Pi.
exports.circumference = function(r){
return 2 * Pi * r;
}
should be:
exports.circumference = function(r){
return 2 * PI * r;
}
You are correct. Nice catch, Matt. We'll get it updated.