{"id":19417187,"url":"https://github.com/mahmud-kandawala/javascript-calculator","last_synced_at":"2026-04-16T08:31:58.810Z","repository":{"id":176123431,"uuid":"622014304","full_name":"Mahmud-Kandawala/JavaScript-Calculator","owner":"Mahmud-Kandawala","description":"This JavaScript Calculator project is one of the five required projects to complete the Front End Development Libraries Certification from freeCodeCamp().","archived":false,"fork":false,"pushed_at":"2023-03-31T22:39:24.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-07T17:18:50.763Z","etag":null,"topics":["bootstrap","css","html","javascript","jquery","math"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mahmud-Kandawala.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-31T22:26:23.000Z","updated_at":"2023-03-31T22:37:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"7621fa2b-075b-44e3-ab01-fa031889aa80","html_url":"https://github.com/Mahmud-Kandawala/JavaScript-Calculator","commit_stats":null,"previous_names":["mahmud-kandawala/javascript-calculator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mahmud-Kandawala%2FJavaScript-Calculator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mahmud-Kandawala%2FJavaScript-Calculator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mahmud-Kandawala%2FJavaScript-Calculator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mahmud-Kandawala%2FJavaScript-Calculator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mahmud-Kandawala","download_url":"https://codeload.github.com/Mahmud-Kandawala/JavaScript-Calculator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240595303,"owners_count":19826360,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap","css","html","javascript","jquery","math"],"created_at":"2024-11-10T13:07:48.530Z","updated_at":"2026-04-16T08:31:53.788Z","avatar_url":"https://github.com/Mahmud-Kandawala.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JavaScript Calculator\n\n\u003cimg src = \"images/calc.png\"\u003e \n\n## Assignment\n\nFulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. Give it your own personal style.\n\nYou can use any mix of HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux, and jQuery to complete this project. You should use a frontend framework (like React for example) because this section is about learning frontend frameworks. Additional technologies not listed above are not recommended and using them is at your own risk. We are looking at supporting other frontend frameworks like Angular and Vue, but they are not currently supported. We will accept and try to fix all issue reports that use the suggested technology stack for this project. Happy coding!\n\nUser Story #1: My calculator should contain a clickable element containing an = (equal sign) with a corresponding `id=\"equals\"`.\n\nUser Story #2: My calculator should contain 10 clickable elements containing one number each from 0-9, with the following corresponding IDs: `id=\"zero\", id=\"one\", id=\"two\", id=\"three\", id=\"four\", id=\"five\", id=\"six\", id=\"seven\", id=\"eight\", and id=\"nine\"`.\n\nUser Story #3: My calculator should contain 4 clickable elements each containing one of the 4 primary mathematical operators with the following corresponding IDs: `id=\"add\", id=\"subtract\", id=\"multiply\", id=\"divide\"`.\n\nUser Story #4: My calculator should contain a clickable element containing a . (decimal point) symbol with a corresponding `id=\"decimal\"`.\n\nUser Story #5: My calculator should contain a clickable element with an `id=\"clear\"`.\n\nUser Story #6: My calculator should contain an element to display values with a corresponding `id=\"display\"`.\n\nUser Story #7: At any time, pressing the clear button clears the input and output values, and returns the calculator to its initialized state; 0 should be shown in the element with the id of display.\n\nUser Story #8: As I input numbers, I should be able to see my input in the element with the id of display.\n\nUser Story #9: In any order, I should be able to add, subtract, multiply and divide a chain of numbers of any length, and when I hit =, the correct result should be shown in the element with the id of display.\n\nUser Story #10: When inputting numbers, my calculator should not allow a number to begin with multiple zeros.\n\nUser Story #11: When the decimal element is clicked, a . should append to the currently displayed value; two . in one number should not be accepted.\n\nUser Story #12: I should be able to perform any operation `(+, -, *, /)` on numbers containing decimal points.\n\nUser Story #13: If 2 or more operators are entered consecutively, the operation performed should be the last operator entered (excluding the negative (-) sign). For example, if `5 + * 7 =` is entered, the result should be `35` `(i.e. 5 * 7); if 5 * - 5 =` is entered, the result should be `-25` `(i.e. 5 * (-5))`.\n\nUser Story #14: Pressing an operator immediately following = should start a new calculation that operates on the result of the previous evaluation.\n\nUser Story #15: My calculator should have several decimal places of precision when it comes to rounding (note that there is no exact standard, but you should be able to handle calculations like `2 / 7` with reasonable precision to at least 4 decimal places).\n\nNote On Calculator Logic: It should be noted that there are two main schools of thought on calculator input logic: immediate execution logic and formula logic. Our example utilizes formula logic and observes order of operation precedence, immediate execution does not. Either is acceptable, but please note that depending on which you choose, your calculator may yield different results than ours for certain equations (see below example). As long as your math can be verified by another production calculator, please do not consider this a bug.\n\n`\nEXAMPLE: 3 + 5 x 6 - 2 / 4 =\n`\n\nImmediate Execution Logic: `11.5`\nFormula/Expression Logic: `32.5`\nYou can build your project by using this CodePen template and clicking Save to create your own pen. Or you can use this CDN link to run the tests in any environment you like: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js`\n\n## Submitting\n\nOnce you're done, submit the URL to your working project with all its tests passing.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahmud-kandawala%2Fjavascript-calculator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmahmud-kandawala%2Fjavascript-calculator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahmud-kandawala%2Fjavascript-calculator/lists"}