Skip to content

Better Algorithm

Latest
Compare
Choose a tag to compare
@FlamesX-128 FlamesX-128 released this 20 Feb 20:49
· 1 commit to master since this release
import { render } from "https://deno.land/x/[email protected]/mod.ts";

const html = Deno.readTextFileSync(
    new URL("assets/main.html", import.meta.url)
);

console.log(
    await render(html, {
        params: {
            timestamp: Date.now()
        }
    })
)
<!-- You can use <deno>, <script type="application/typescript">, or a custom query by adjusting the configuration. -->
<body>
    <p>
        The value of the fibonacci sequence is:
        <script type="application/typescript">
            function fibonacci(n: number): number {
                if (n <= 1) {
                    return n;
                }
                return fibonacci(n - 1) + fibonacci(n - 2);
            }
    
            return fibonacci(20);
        </script>
    </p>

    <deno>
        return Date.now() - params.timestamp;
    </deno>
</body>
<!-- When evaluated, it becomes into this -->
<!DOCTYPE html>
<html lang="es">

<head>
    <title>denoTag</title>
</head>

<body>
    <p>
        The value of the fibonacci sequence is:
        6765
    </p>

    13
</body>

</html>