JSFiddle - React, Tailwind, and code Playground
JavaScript
function test(i) {
// Named Function expression
var hello = function hello(i) {
if(i < 6) {
console.log(i);
// recursion. calling the same function
// Since its a named function expression, we can use the name test
hello(i+1);
}
return;
}
// calling the name function
hello(i);
}
test(1);