Created
February 9, 2018 14:49
-
-
Save petyosi/aa05da6a1baca1975590169806815b6f 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 our image utility | |
import addImageToPage from './image_util'; | |
// import the images we want to use | |
import multiplyImg from '../images/multiply.png'; | |
import sumImg from '../images/sum.png'; | |
// 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 | |
addImageToPage(multiplyImg); | |
document.body.appendChild(multiplyResultsSpan); | |
addImageToPage(sumImg); | |
document.body.appendChild(sumResultSpan); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment