JSFiddle - React, Tailwind, and code Playground

by shareef hiasat

JavaScript

iteration = 0;
func1();

    function  func1() {
        var result = func2("haha");
        alert(iteration + ":" + result);
    }

    function func2 (sWord) {
        iteration++;

        sWord = sWord + "lol";
        if ( iteration < 5 ) {
            func2( sWord);
        } else {

            return sWord;
        }

    return sWord;
    }