JSFiddle - React, Tailwind, and code Playground

by Alex Fogarty

JavaScript

function calculateInterest(investment) {
    var results;
    if (investment < 1000) {
        results = investment * 1.05;
    }
    alert(results);
}

// test our function
calculateInterest(500);
calculateInterest(20000);