Created
March 6, 2012 18:42
-
-
Save aareese/1988107 to your computer and use it in GitHub Desktop.
First shot JS code for assigning company shares
Check out http://visionmedia.github.com/mocha/ for testing. It works in the browser or node.js. Mocha is often paired with http://chaijs.com for the actual assertions in your tests. Don't worry about a console just yet. You can just make a test.html file with the right <script> tags and run your tests that way.
If I were you...
I would run it through a syntax checker such as jshint.com
And I would test it at jsfiddle.net
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Check it out. I decided to put my fledgling JS skills to test to write a little program for tracking & assigning company shares. The idea I had is something I'm thinking of doing for my UI/UX design firm, fleetCreature. There are 100 shares to begin with. I would own all of them to start: 30% as non-diminishable shares that I will always retain & 70% as diminishable shares that anyone working in the company can earn a percentage of. After the first year of their work, everyone is awarded 10 shares. Then for every year that someone works on the company following that, they are awarded 10 shares. If they work part of a year after the first year, they are awarded proportionally with the number rounded up to the nearest share. The program will be run once a year to award shares.
Pretty sure there's a lot of errors, etc but it was fun to write. Let me know what you think! Also, if anyone could give me a hint on what to use to test my JS, that would be awesome. RIght now I'm just writing it in Sublime Text 2 & am not sure how to actually run it in a console.
Cheers - Alyssa
http://fleetcreature.com