JSFiddle - React, Tailwind, and code Playground

by kornim

HTML

<script src="https://getfirebug.com/firebug-lite-debug.js"></script>

JavaScript

//Javascript Inside 5.4.2.1

function HelloFunc(func) {
    this.greeting = "hello";
}

// user definition function
var userFunc = function(greeting) {
    console.log(greeting);
}

HelloFunc.prototype.call = function(func) {
    func ? func(this.greeting) : this.func(this.greeting);
}

var objHello = new HelloFunc();

objHello.func = userFunc;
objHello.call();