calculator.mov
"Do you have any hobbies?"
"I count."
-- Count von Count, Sesame Street
This is version 1.0 of a JavaScript project that creates a basic calculator.
- Create a Folder to hold the program
- in the terminal type
mkdir Calculator
or whatever other name you want to call it.- navigate into the folder by typing
cd Calculator
- clone the program into the Calculator folder you just created by typing:
https://github.com/trrapp12-ironyard/calculator.git
2. Make sure you are still in the Calculator folder. You can type `cd ..` to move to navigate out to the parent directory or `cd` to navigate further down into the file.
3. You should be able to see a page named 'index.html'. If not use `cd ..` to navigate back into the Calculator folder.
4. Type `start index.html` to run the program from the terminal (in Windows), or `open index.html` on a Mac.
5. The program runs from prompts displayed by the browser as dialog boxes on the page. Due to the nature of the `window.prompt()` function, to page will not execute any more of the JavaScript until the prompt is answered. Therefore:
- if you fail to click "continue", the page won't advance
- if you put a non-number (NaN) value in the prompt, it will return an error message.
- if you do not put any number in it will submit a "Null" value, and you will get an error message.
6. Enjoy!
-
use of an IFFE function.
-
use of multiple functions to create a script.
-
use of hoisting in JavaScript.
-
use of parameters in functions.
-
use of
prompt()
to get user input. -
use of
===
as a strict equality operator. -
ECMAScript 6: use of
let
as a block scope variable. -
use of index.html
-
use of
<script>
tags -
Flex-box
- It was a pretty straight forward bootcamp assignment, but as always it's always easy when you know the answer. At the time the new material was new and I just had to put in time and practice learning.
- This project was a bootcamp assignment, but the work provided is all my own.
- no attributions necessary
*For more information see my LinkedIn, or return to my Github