Description Usage Arguments Details Examples
Find the ith previous index while avoiding 0 or negative indexes.
1 | previous_i(x, n_prev)
|
x |
Current index |
n_prev |
Target number of indexes before x |
This function is used to find the nth previous index without making an error with negative or 0 index.
1 2 3 4 5 | # Find the 10th index before 15:
previous_i(15,10)
# Find the 10th index before 5:
previous_i(5,10)
# should return 1 (no index before 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.