Home / Function/ shuffle() — fastapi Function Reference

shuffle() — fastapi Function Reference

Architecture documentation for the shuffle() function in custom.js from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  7fe5a860_b558_ff48_72c2_88faa26a8f2b["shuffle()"]
  49961dba_6b4d_9e52_de16_4ef5b04a5bea["custom.js"]
  7fe5a860_b558_ff48_72c2_88faa26a8f2b -->|defined in| 49961dba_6b4d_9e52_de16_4ef5b04a5bea
  10029d9b_fc07_27cd_ecbc_58b6581f93df["showRandomAnnouncement()"]
  10029d9b_fc07_27cd_ecbc_58b6581f93df -->|calls| 7fe5a860_b558_ff48_72c2_88faa26a8f2b
  style 7fe5a860_b558_ff48_72c2_88faa26a8f2b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

docs/en/docs/js/custom.js lines 115–125

function shuffle(array) {
    var currentIndex = array.length, temporaryValue, randomIndex;
    while (0 !== currentIndex) {
        randomIndex = Math.floor(Math.random() * currentIndex);
        currentIndex -= 1;
        temporaryValue = array[currentIndex];
        array[currentIndex] = array[randomIndex];
        array[randomIndex] = temporaryValue;
    }
    return array;
}

Domain

Subdomains

Frequently Asked Questions

What does shuffle() do?
shuffle() is a function in the fastapi codebase, defined in docs/en/docs/js/custom.js.
Where is shuffle() defined?
shuffle() is defined in docs/en/docs/js/custom.js at line 115.
What calls shuffle()?
shuffle() is called by 1 function(s): showRandomAnnouncement.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free