Finished lab, functional temperature calculator#1
Open
JRedden27 wants to merge 1 commit intoReturn-Ready-2021-JavaScript-Evening:mainfrom
Open
Finished lab, functional temperature calculator#1JRedden27 wants to merge 1 commit intoReturn-Ready-2021-JavaScript-Evening:mainfrom
JRedden27 wants to merge 1 commit intoReturn-Ready-2021-JavaScript-Evening:mainfrom
Conversation
kburd
reviewed
Dec 8, 2020
| } | ||
|
|
||
| // HTML Editing (Not sure if this is the proper indenting style, but it helped me keep track of the code.) | ||
| document.getElementById("tempBody").innerHTML += `<div id="outerBorder" class ="card m-3"></div>`; |
There was a problem hiding this comment.
I would put some of the elements on the HTML, no need to generate the app title, scale dropdown, or input with the DOM
| buttonCol.innerHTML += `<br><button id="tempButton" onclick ="farenheitDisplay(), fToC(), fToK(), fToR()" class="px-4 mt-2">Calculate</button>`; | ||
| } else if(dropDown.value == "celsius") { | ||
| buttonCol.innerHTML = ""; | ||
| buttonCol.innerHTML += `<br><button id="tempButton" onclick ="celsiusDisplay(), cToF(), cToK(), cToR()" class="px-4 mt-2">Calculate</button>`; |
There was a problem hiding this comment.
It would be better to have the button always call one function, say calculate() and in the calculate method you determine what values to display and how to calculate them
| document.getElementById("farenheitValue").innerText = `${f} \xB0F`; | ||
| } | ||
|
|
||
| function kToC(k, c) { |
There was a problem hiding this comment.
You can get the same result with less conversion methods, if you had a method to convert each scale in Fahrenheit and from Fahrenheit into the other three, you would only have 6 equations
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.