JSFiddle - React, Tailwind, and code Playground

by NerfAnarchist

JavaScript

// this is for knowing how to use javascript .apply()
$(function () {
    var methods = {
        one : function (em) {
            document.write(em + '<br />');
        },
        two : function (em) {
            document.write(em + '<br />');
        },
    };
    methods.one.apply(null, ['Hello']);// the first parameter is the "this" variable if you want a context
    methods.two.apply(null, ['World!']);// the second parameter is an array of the parameters that go to the function
});