Title: Add return on investment algorithm to Maths by InukaWijerathna · Pull Request #1906 · TheAlgorithms/JavaScript · GitHub
Open Graph Title: Add return on investment algorithm to Maths by InukaWijerathna · Pull Request #1906 · TheAlgorithms/JavaScript
X Title: Add return on investment algorithm to Maths by InukaWijerathna · Pull Request #1906 · TheAlgorithms/JavaScript
Description: Description Adds a returnOnInvestment function to the Maths/ directory, along with a full test suite. Return on Investment (ROI) is a fundamental financial metric that quantifies how profitable an investment is relative to its cost: ROI = (Gain from Investment - Cost of Investment) / Cost of Investment × 100 Files changed Maths/ReturnOnInvestment.js — implementation with JSDoc, type checking, and RangeError for invalid inputs Maths/test/ReturnOnInvestment.test.js — 8 test cases covering positive/zero/negative ROI and all error paths Checklist Follows the code style of the project (ESM exports, no console, JSDoc) Throws TypeError for non-number inputs Throws RangeError for invalid cost (zero or negative) All test cases pass Reference: https://www.investopedia.com/terms/r/returnoninvestment.asp
Open Graph Description: Description Adds a returnOnInvestment function to the Maths/ directory, along with a full test suite. Return on Investment (ROI) is a fundamental financial metric that quantifies how profitable an ...
X Description: Description Adds a returnOnInvestment function to the Maths/ directory, along with a full test suite. Return on Investment (ROI) is a fundamental financial metric that quantifies how profitable an ...
Opengraph URL: https://github.com/TheAlgorithms/JavaScript/pull/1906
X: @github
Domain: Github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:a8019d1e-fea2-a7c7-49d2-9b46fd713c24 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A7E4:190D15:1EE8D3:2AD880:6A630078 |
| html-safe-nonce | d0cf66461667937c26c59593606bc4bf0cffb0bdbdf77f9c7bb9918af87debf4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBN0U0OjE5MEQxNToxRUU4RDM6MkFEODgwOjZBNjMwMDc4IiwidmlzaXRvcl9pZCI6IjI0MjI5NjcyMTU4MzcwODU4MTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ba6d7f80fd554217d5d7da5c4e09c82666cd9ffcc0a05cbbaa9daf83ff39882b |
| hovercard-subject-tag | pull_request:3807789546 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/TheAlgorithms/JavaScript/pull/1906/files |
| twitter:image | https://avatars.githubusercontent.com/u/180553425?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/180553425?s=400&v=4 |
| og:image:alt | Description Adds a returnOnInvestment function to the Maths/ directory, along with a full test suite. Return on Investment (ROI) is a fundamental financial metric that quantifies how profitable an ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 14517cd57568049be7ed25bfe9708f10d1e36b7254adfd920dfb9d44bcc71c41 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/TheAlgorithms/JavaScript git https://github.com/TheAlgorithms/JavaScript.git |
| octolytics-dimension-user_id | 20487725 |
| octolytics-dimension-user_login | TheAlgorithms |
| octolytics-dimension-repository_id | 97086543 |
| octolytics-dimension-repository_nwo | TheAlgorithms/JavaScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 97086543 |
| octolytics-dimension-repository_network_root_nwo | TheAlgorithms/JavaScript |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4b2ed33e3827bc186c45c037f9274b5493aaca4c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width