JSFiddle - React, Tailwind, and code Playground

by Alex Alex

JavaScript

(function () {
    "use strict";

    var obj = {}
    var n = 1;



    obj['method' + n] = function () {
        alert('do something');
    }

    obj['method' + n]();

    delete obj['method' + n];

    n = n + 1;

    obj['method' + n] = function () {
        alert('do something');
    }

    alert(Object.keys(obj));
})();