Home / Function/ randomFromArray() — astro Function Reference

randomFromArray() — astro Function Reference

Architecture documentation for the randomFromArray() function in icons.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  4fd6962b_8896_d71b_8708_24cf922f4af1["randomFromArray()"]
  9038303f_ab7f_4de5_58f6_bbab3a318f46["icons.ts"]
  4fd6962b_8896_d71b_8708_24cf922f4af1 -->|defined in| 9038303f_ab7f_4de5_58f6_bbab3a318f46
  d64bb64c_a73d_a0eb_2cd6_a08051404fe3["iconForIntegration()"]
  d64bb64c_a73d_a0eb_2cd6_a08051404fe3 -->|calls| 4fd6962b_8896_d71b_8708_24cf922f4af1
  fca9c48f_6af2_622f_cdf1_cfd45f9168fd["colorForIntegration()"]
  fca9c48f_6af2_622f_cdf1_cfd45f9168fd -->|calls| 4fd6962b_8896_d71b_8708_24cf922f4af1
  style 4fd6962b_8896_d71b_8708_24cf922f4af1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/runtime/client/dev-toolbar/apps/utils/icons.ts lines 3–5

function randomFromArray<T>(list: T[]) {
	return list[Math.floor(Math.random() * list.length)];
}

Domain

Subdomains

Frequently Asked Questions

What does randomFromArray() do?
randomFromArray() is a function in the astro codebase, defined in packages/astro/src/runtime/client/dev-toolbar/apps/utils/icons.ts.
Where is randomFromArray() defined?
randomFromArray() is defined in packages/astro/src/runtime/client/dev-toolbar/apps/utils/icons.ts at line 3.
What calls randomFromArray()?
randomFromArray() is called by 2 function(s): colorForIntegration, iconForIntegration.

Analyze Your Own Codebase

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

Try Supermodel Free