JSFiddle - React, Tailwind, and code Playground

by rmurphey

JavaScript

// Write a function that takes a number as its argument. 
// If the number is less than 10, the function should return "small"; 
// if the number is between 10 and 100, the function should return "medium"; // if the number is greater than 100, the function should return "large".



function bigOrSmall(arg) {
    if (arg > 100) {
        return "large";
    }
    if (arg > 9) {
        return "medium";
    }
    return "small";
};