Skip to content

Add a factorial function #3

@swinton

Description

@swinton

It would be cool if the calculator provided a way to calculate factorials, e.g.

n n!
0 1
1 1
2 2
3 6
4 24

It looks like we just need to expose a new factorial function here:

var operations = {
'add': function(a,b) { return +a + +b },
'subtract': function(a,b) { return a - b },
'multiply': function(a,b) { return a * b },
'divide': function(a,b) { return a / b },
};





Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions