Skip to content

Instantly share code, notes, and snippets.

View eddyw's full-sized avatar
🏠
Working from home

Eddy Wilson eddyw

🏠
Working from home
View GitHub Profile
@hurryabit
hurryabit / stack_safe.js
Last active June 14, 2022 09:34
Stack-safety for free?
// This gist contains the JavaScript version of the code from the blog post
// https://hurryabit.github.io/blog/stack-safety-for-free/
function triangular(n) {
if (n == 0) {
return 0;
} else {
return n + triangular(n - 1);
}
}