JSFiddle - React, Tailwind, and code Playground

by Stijntjhe

JavaScript

var myObject = 
{ 
    method: function () 
    { 
        this.nestedMethod = function () 
        { 
        } 
    },
    anotherMethod: function() { } 
}

function properties(obj) 
{
    var output = "";
    for (var prop in obj) {
        output += prop + "<br />";
        
        var temp = new obj[prop]();
        output += properties(temp);
    }
    
    return output;
}

window.alert(properties(myObject));