From d321d8366b597e46ff8e3fc63d17622a9297505c Mon Sep 17 00:00:00 2001 From: aFuzzyBear Date: Tue, 10 Aug 2021 01:24:25 +0100 Subject: Adds examples page --- docs/src/components/Examples/Functions/random-index.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 docs/src/components/Examples/Functions/random-index.js (limited to 'docs/src/components/Examples/Functions/random-index.js') diff --git a/docs/src/components/Examples/Functions/random-index.js b/docs/src/components/Examples/Functions/random-index.js new file mode 100644 index 000000000..a55487da5 --- /dev/null +++ b/docs/src/components/Examples/Functions/random-index.js @@ -0,0 +1,9 @@ +/** + * Random Index from Array + * @param {Number} length - Length of Array + * @returns Random Index from the Array + */ + +const randomIndex = (length) => Math.round(Math.random() * (0-length)) + length - 1 + +export default randomIndex \ No newline at end of file -- cgit v1.2.3