XahTV 2021-03-11 demo of Wolfram Language Mathematica

XahTV 2021-03-11 demo of Wolfram Language Mathematica
// write a function to do factorial

/* [
xah_range(min, max) → return a array from min to max, inclusive.
xah_range(min, max, step) → in steps of step.
If step is not integer, then max may not be included.
http://xahlee.info/js/javascript_range_array.html
version 2019-10-31
] */
const xah_range = (( min, max, step = 1, ) => (Array(Math.floor((max - min) / step) + 1).fill(min).map( ((x, i) => (x + i * step)), )));

const factorial = ((x) => xah_range(1,x).reduce(((a,b) => a*b)));

console.log( factorial(100) );

Topic talked:

xah_talk_show_2021-03-11.txt

Wolfram Language