Instantly share code, notes, and snippets.

Embed
What would you like to do?
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