jth is an alternative syntax for javascript centerered around squential data processing.
npm install jth-stats⚠️WARNING⚠️
Jth is still very much a work in progress.
- Many ideas around how the language _should_ work
are up in the air.
- Many bugs exist in the implementation.
Note that by convention,
functions that operate
on the stack (by taking and returning an array) are suffixed with "$".
Dependencies: node/npm
Install with command:
```
npm install jth-stats
Returns the number of items in the current stack.
`javascript`
import { count$ } from "jth-stats";
1 2 3 count$!! @!!; /prints "3"/
`javascript`
import { randomize$ } from "jth-stats";
1 2 3 randomize$!! @!!; /prints "1 2 3" or "3 1 2" or... it's random/
Sorts stack ascending
`javascript`
import { sort$ } from "jth-stats";
2 1 3 sort$!! @!!; /prints "1 2 3"/
Sorts stack descending
`javascript`
import { sortD$ } from "jth-stats";
2 1 3 sortD$!! @!!; /prints "3 2 1"/
Returns sum of numbers on stack
`javascript`
import { sum$ } from "jth-stats";
1 2 3 4 sum$!! @!!; /prints "10"/
Returns product of numbers on stack
`javascript`
import { product$ } from "jth-stats";
1 2 3 4 product$!! @!!; /prints "24"/
Returns mean of numbers on stack
`javascript`
import { mean$ } from "jth-stats";
1 2 3 4 mean$!! @!!; /prints "2.5"/
Returns median of numbers on stack
`javascript`
import { median$ } from "jth-stats";
1 2 3 4 5 median$!! @!!; /prints "3"/
``
Returns mode of numbers on stack
`javascript``
import { mode$ } from "jth-stats";
1 1 2 3 4 mode$!! @!!; /prints "1"/
Returns all modes on stack
`javascript``
import { modes$ } from "jth-stats";
1 1 2 2 3 4 modes$!! @!!; /prints "1 2"/