Display A Random Text?

@prestonkelpiek9 This is the code that was used:

import wixData from 'wix-data';

$w.onReady(function () {
        wixData.query("DatabaseID")
            .find()
            .then((result) => {
                const shuffledArray = shuffleArray(result.items);
                console.log(shuffledArray)
                $w('#textID').text = String(shuffledArray[0].title);
            })
            .catch((err) => {
                let errorMsg = err;
            });
});

function getRandomIndex(min, max) {
    return Math.round(Math.random() * (max - min) + min);
}

function shuffleArray(dataArray) {


    for (let i = dataArray.length - 1; i > 0; i--) {
        let index = getRandomIndex(0, i);
        const temp = dataArray[i];
        dataArray[i] = dataArray[index];
        dataArray[index] = temp;
    }

    return dataArray;
}

You will need to change DatasbaseID to the ID of your database. And textID will need to change to the ID of the text you want to display the random text within.