Skip to content

Instantly share code, notes, and snippets.

Created Jun 20, 2016
What would you like to do?
Simple example of proper tail calls in ECMAScript 2015
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>Example of Proper Tail Calls</title>
<h1>Example of Proper Tail Calls</h1>
Please open console. If your web browser supports proper tail calls, it shows "It works!".
"use strict";
function f(n){
if (n <= 0) {
return "It works!";
return f(n - 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment