Skip to content

Instantly share code, notes, and snippets.

@bpatra
Last active December 8, 2020 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bpatra/05730033f7a92e261ef0 to your computer and use it in GitHub Desktop.
Save bpatra/05730033f7a92e261ef0 to your computer and use it in GitHub Desktop.
app.sut module with the factorial function
/// <reference path="./app.js" />
app.namespace("app.sut");
app.sut = (function () {
"use strict";
var sut = {};
var factorial = function (n) {
if (n <= 1) return 1;
return n*factorial(n - 1);
}
sut.factorial = factorial;
return sut;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment