JSFiddle - React, Tailwind, and code Playground

by burhans

HTML

<button onClick="testit()"/>

JavaScript

function testit()
{
    var testValue;
    
    testValue = blammo();
    alert("no params: " + testValue);
    
    testValue = blammo(false);
    alert("param(false): " + testValue);
    
    testValue = blammo();
    alert("param(true): " + testValue);
}

function blammo(desiredBlammo)
{
    var returnValue;
    
    if (desiredBlammo)
    {
        returnValue = desiredBlammo
    }
    else
    {
        returnValue = false;
    }
    
    return returnValue;
}