JSFiddle - React, Tailwind, and code Playground
JavaScript
var x=0;
async function increment(x) {
++x;
setTimeout(() => {console.log('value of x is: ' + x);}, 1000);
};
increment(x);
console.log('Out of the function');
var x=0;
async function increment(x) {
++x;
setTimeout(() => {console.log('value of x is: ' + x);}, 1000);
};
increment(x);
console.log('Out of the function');