Created
February 9, 2018 14:46
-
-
Save petyosi/c52917936048222286e1f41fdf7ac4ab to your computer and use it in GitHub Desktop.
This file contains hidden or 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'; | |
// import the CSS we want to use here | |
import './math_output.css'; | |
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