Control flow, boolean, variables dataTypes
Create the following variables and in a comment after the variable, state the type that it is. If you are unsure of the type, use the function typeof
to find it out. Note that some types may not be what you expect...
- The number that represents pi.
- Your full name.
- A list of prime numbers.
- The number 87
- If you are taking WDI or not.
- Create an array.
- Add 3 places you have visited in your life.
- Remove two of them from the front of the array.
- Add 3 places that you would like to travel to.
- Remove one of them from the end of the array.
- Change the value of the second index to Japan.
- Change the first string in the array to Where am I going?
- add the number 8 to the end of your array.
- Create a function that detects if a user is able to purchase alcohol.
- If so,
console.log
out that they may have a drink. - Else, warn them via
console.log
to not break the law.
Create a function that take an integer (in Fahrenheit) and convert the temperature to Celsius. The output of the program should read: "X degrees Fahrenheit is Y degrees Celsius"
Remember you can test all of these in the javascript console in the browser!
git add .
git commit -m "a message"
git push origin master
Go to your github fork, and make a pull request!