Created
February 9, 2018 14:44
-
-
Save petyosi/6879b843d9287b56391bbfd6be489bc6 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
import multiply from './multiply'; | |
import sum from './sum'; | |
const totalMultiply = multiply(5, 3); | |
const totalSum = sum(5, 3); | |
// create the body | |
const body = document.createElement("body"); | |
document.documentElement.appendChild(body); | |
// calculate the product and add it to a span | |
const multiplyResultsSpan = document.createElement('span'); | |
multiplyResultsSpan.appendChild(document.createTextNode(`Product of 5 and 3 = ${totalMultiply}`)); | |
// calculate the sum and add it to a span | |
const sumResultSpan = document.createElement('span'); | |
sumResultSpan.appendChild(document.createTextNode(`Sum of 5 and 3 = ${totalSum}`)); | |
// add the results to the page | |
document.body.appendChild(multiplyResultsSpan); | |
document.body.appendChild(sumResultSpan); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment