Skip to content

Instantly share code, notes, and snippets.

View alvissraghnall's full-sized avatar
🤖
Building

xavier alvissraghnall

🤖
Building
View GitHub Profile
@alvissraghnall
alvissraghnall / tribinnov.js
Created March 30, 2022 20:49
A brief solution at the Tribinnov Africa Assessment test question.
/**
* Collects inputs in percentages, for example: COOP(30, 20, 10, 15, 25) means 30%, 20%, 10%, 15%, and 25% respectively.
*
*/
function COOP (loan, convertibleNote, grants, equity, sharedProfits, baseAmount = 5000) {
const args = [ ...arguments ];
if(args.length < 5) throw new Error("Must provide percentages for all sub-wallets");
if(baseAmount !== 5000) {
throw new Error("Invalid Base Amount. Ensure it is 5000.");