ibvasi
4/6/2017 - 2:06 AM

Closures

Closures

function family(firstname, lastname) {
    var greet = "How are you";

    function familyOne() {
        var welcome = "Hi," + " " + greet + " " + firstname + " " + lastname;
        return welcome;
    }
    return familyOne();
}
console.log(family("Arwa", "Vasi")); // Hi, How are you Arwa Vasi