generated from LaunchCodeEducation/Launch-Checklist
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscriptHelper.js
56 lines (41 loc) · 1.8 KB
/
scriptHelper.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Write your helper functions here!
require('isomorphic-fetch');
function addDestinationInfo(document, name, diameter, star, distance, moons, imageUrl) {
// Here is the HTML formatting for our mission target div.
/*
<h2>Mission Destination</h2>
<ol>
<li>Name: </li>
<li>Diameter: </li>
<li>Star: ${star}</li>
<li>Distance from Earth: </li>
<li>Number of Moons: </li>
</ol>
<img src="">
*/
}
function validateInput(testInput) {
}
function formSubmission(document, list, pilot, copilot, fuelLevel, cargoLevel) {
}
async function myFetch() {
let planetsReturned;
planetsReturned = await fetch().then( function(response) {
});
return planetsReturned;
}
function pickPlanet(planets) {
}
module.exports.addDestinationInfo = addDestinationInfo;
module.exports.validateInput = validateInput;
module.exports.formSubmission = formSubmission;
module.exports.pickPlanet = pickPlanet;
module.exports.myFetch = myFetch;
/*ONLY MODIFY THIS AND SCRIPT.JS*/
/*
Adding Validation
Adding Alerts
In scriptHelper.js, you will use validateInput() to complete the formSubmission() function. formSubmission() will take in a document parameter and strings representing the pilot, co-pilot, fuel level, and cargo mass. Using the values in those strings and the document parameter for your HTML document, update the shuttle requirements as described below. Make sure to call your formSubmission() function at the appropriate time in your script.js file!
Note
If you want to check if something is NaN, you cannot use == or ===. Instead, JavaScript has a built-in method called isNaN(value) that returns true if value is NaN and false if value is not NaN.
*/