Last active
February 9, 2018 14:40
-
-
Save petyosi/9eebfe9dfb2ec991441b249a966a5303 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="./dist/bundle.js""></script> | |
</head> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var multiply = require('./multiply'); | |
var sum = require('./sum'); | |
var totalMultiply = multiply(5, 3); | |
var totalSum = sum(5, 3); | |
console.log('Product of 5 and 3 = ' + totalMultiply); | |
console.log('Sum of 5 and 3 = ' + totalSum); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sum = require('./sum'); | |
var multiply = function (a, b) { | |
var total = 0; | |
for (var i = 0; i < b; i++) { | |
total = sum(a, total); | |
} | |
return total; | |
}; | |
module.exports = multiply; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sum = function (a, b) { | |
return a + b; | |
}; | |
module.exports = sum; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment