JSFiddle - React, Tailwind, and code Playground

by dhizzybusy

HTML

<!DOCTYPE html>
<html>
<head>
<script src="Queue.js"></script>
</head>
<body>
Enter the value of n: <input type="number" id="myNumber" value="2">
<button onclick="f(n)">Okay</button>
<p id = "myDiv"></p>
</body>
</html>

JavaScript

function f(n) {
if (n == 4) return n;
return 2*f(n+1);
}