JSFiddle - React, Tailwind, and code Playground

JavaScript

function MyClass() {
    this.hoge = 'hoge';
    this.piyo = {
        foo: 'foo',
        bar: [1, 2, 3]
    };
    this.func = function () {
        return 'this is function';
    };
}

MyClass.prototype = {
    fuga: 'fuga'
};

var obj = new MyClass();

for (key in obj) {
    console.log(key, obj[key]);
}