JSFiddle - React, Tailwind, and code Playground

by rvrjp7

HTML

<!DOCTYPE html>
<html>
<body>
<p>This example calls a function which performs a calculation, and returns the result:</p>

<p id="demo"></p>

<script>
function myFunction(p1, p2) {

	this.test(p1);
    return p1 * p2;
}

 function test(num1){
  console.log(num1);
    console.log(num1, p1, p2);// p1 p2 values are undefined
}
document.getElementById("demo").innerHTML = myFunction(4, 3);
</script>

</body>
</html>