Preparing search index...
The search index is not available
prototyped.js - v3.0.5
prototyped.js - v3.0.5
array
sample
Function sample
sample
<
T
>
(
arr
:
T
[]
)
:
T
Returns a random element from an array
Example
sample
([
3
,
7
,
9
,
11
]);
// 9
Type Parameters
T
Parameters
arr:
T
[]
Returns
T
Settings
Member Visibility
Protected
Private
Inherited
External
Theme
OS
Light
Dark
Modules
prototyped.js -
v3.0.5
array
boolean
date
func
globals
math
number
object
string
CompactT
Nested
ArrayT
OrderT
all
any
append
average
chunk
clone
compact
contains
count
count
By
cross
Join
deep
Flatten
diff
distinct
distinct
By
empty
equals
every
Nth
first
flatten
get
group
By
implode
index
Of
All
initial
intersect
is
Empty
last
limit
max
median
merge
min
nest
order
By
pad
partition
pluck
prepend
pull
range
repeat
sample
shuffle
skip
sort
By
sum
tail
toCSV
union
unwind
where
where
Between
where
In
where
Like
where
Not
Between
where
Not
In
where
Not
Like
where
Not
Null
where
Null
zip
zip
Object
Generated using
TypeDoc
Returns a random element from an array
Example