JSFiddle - React, Tailwind, and code Playground

by sanpopo

HTML

<input type='button' id='testButton' onclick='func3()' value='Click Me' />
<input type='button' id='testButton2' onclick='func3a(true)' value='Click Me Also' />

JavaScript

func3 = function (aBool) {
    func2(func1);
}

// I want to be able to pass a parameter to the function 
// that gets called in func2 
func3a = function (aBool) {
    func2(func1(aBool));
}

func1 = function (data, myBool) {
    alert(data[0] + ' ' + myBool);
}

// Cannot Change this function 
func2 = function (func) {
    var data = [];
    data[0] = "Hello World"
    func(data);
}