JSFiddle - React, Tailwind, and code Playground

JavaScript

var i = 'global'; 

function test(){
    var i;
    alert(i);   
    for(i = 0; i < 10; i++){
     //do something   
    }
}
test();