Flowchart (ISO 5807)
Source code
JavaScript
function factorial(n) {
let r = 1;
for (let i = 2; i <= n; i++) {
r *= i;
}
return r;
}The editor opens with this code — change it and the chart redraws.
- Language
- JavaScript
- Constructs
- for with accumulation
- Topic
- Loops
- Formats
- Word, Visio, draw.io, PDF, SVG