spacetoastcoasttocoast / cash-register Goto Github PK
View Code? Open in Web Editor NEWThis project forked from devleague/cash-register
Closure and Revealing Module Pattern exercise
This project forked from devleague/cash-register
Closure and Revealing Module Pattern exercise
[2.00]
plus (+)
[2.00]
plus (+)
Display shows "4.00"
[2.00]
plus (+)
Display shows "6.00"
...
and so forth
use case:
$5.00
is displayed$5.00
is displayed0
should be displayed2
should be displayed$10.00
should be displayedand for clarity, some marker that shows that multiply
is the current opState
like displaying ร 2
instead of 2
or highlighting the [ ร ] button
create the branch, you should be able to visit your app at
https://SpaceToastCoastToCoast.github.io/Cash-Register/
more info: https://pages.github.com/
an "enum" would be good here
use case:
$7.00
$2.00
after doing #1 if the opCodes match calculator module functions (add, subtract...)
then this switch statement can be removed
https://github.com/SpaceToastCoastToCoast/Cash-Register/blob/master/js/cash_register.js#L70
hint: use bracket notation to access property names of the cashRegister.calc
module
you can enable gh_pages for this project, and create a branch named gh_pages
so that anyone can visit: https://SpaceToastCoastToCoast.github.io/Cash-Register/
references #5
Keep just Cash register operations in the cashRegister module and make a new module that handles updating the DOM, and initializing the calculator. This would allow you to further seperate your concerns out and get even cleaner code ๐
Display confuses users when multiplying and dividing.
Ex.
[2.00]
x
2 (displays 200 instead however)
= 8.00 (correct!)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.