JSFiddle - React, Tailwind, and code Playground

HTML

<script>
    function start(){
        var counter = 10;
        var fun = function(){
            counter = 20;
        }
        return counter;
    }
</script>
<button onclick="alert(start());">start</button>