JSFiddle - React, Tailwind, and code Playground

by Viet27th

JavaScript

/* function wait(ms){
   var start = new Date().getTime();
   var end = start;
   while(end < start + ms) {
     end = new Date().getTime();
  }
}


console.log('before');
wait(3000);  //7 seconds in milliseconds
console.log('after'); */

	let age =1;
let user = function(name) {

	return function() {
  	console.log(name, age)
  }
}
age = 2;
let a = user('XuanDieu');
a();