Platform
Resources
Pricing
Sign in
Get started
Michaël Guitton
Over 2 decades of experience on the Web…
Workspace
Fork
Public
By
Michaël Guitton
Edited
Nov 29, 2022
ISC
1
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
array
.
includes
(
void
0
)
Insert cell
d3
.
extent
(
array
)
Insert cell
[
getMinOf
,
getMaxOf
]
[
+
toggle
]
(
array
)
===
result
Insert cell
result
=
function
(
)
{
}
.
constructor
.
call
(
null
,
[
minOf
,
maxOf
]
[
+
toggle
]
.
text
.
trim
(
)
)
(
array
)
Insert cell
Math
.
max
(
...
array
)
Insert cell
Reflect
.
apply
(
Math
.
max
,
null
,
array
)
Insert cell
Function
(
`return Math.max(${
String
(
array
)
.
replace
(
/,+/g
,
","
)
})`
)
(
)
// cope with undefined values!
Insert cell
Function
(
`return Math.max.apply(null, [${
String
(
array
)
.
replace
(
/,+/g
,
","
)
}])`
)
(
)
// bypass the erroneous 65535 maximum argument count in Blink browser engine…
Insert cell
getMaxOf
(
array
)
Insert cell
findMaxOf
(
array
)
Insert cell
Math
.
min
(
...
array
)
Insert cell
Reflect
.
apply
(
Math
.
min
,
null
,
array
)
Insert cell
Function
(
`return Math.min(${
String
(
array
)
.
replace
(
/,+/g
,
","
)
})`
)
(
)
// cope with undefined values!
Insert cell
Function
(
`return Math.min.apply(null, [${
String
(
array
)
.
replace
(
/,+/g
,
","
)
}])`
)
(
)
// bypass the erroneous 65535 maximum argument count in Blink browser engine…
Insert cell
getMinOf
(
array
)
Insert cell
findMinOf
(
array
)
Insert cell
Insert cell
<
script
defer
src
=
"data:,"
>
// the following function uses Function.prototype.apply() to get the maximum of an array
return
(
function
maxOf
(
array
)
{
return
Math
.
max
.
apply
(
null
,
array
)
;
}
)
(
Array
.
from
(
arguments
)
.
pop
(
)
)
</
script
>
Insert cell
Insert cell
Insert cell
Insert cell
<
script
defer
src
=
"data:,"
>
// the following function uses Function.prototype.apply() to get the minimum of an array
return
(
function
minOf
(
array
)
{
return
Math
.
min
.
apply
(
null
,
array
)
;
}
)
(
Array
.
from
(
arguments
)
.
pop
(
)
)
</
script
>
Insert cell
Insert cell
Insert cell
Insert cell
array
.
indexOf
(
void
0
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
let
copy
=
array
.
slice
(
)
;
copy
.
push
.
apply
(
copy
,
copy
)
;
yield
copy
.
sort
(
(
a
,
b
)
=>
a
-
b
)
;
}
Insert cell
Insert cell
{
let
copy
=
array
.
slice
(
)
;
for
(
let
i
=
0
,
length
=
copy
.
length
;
i
<
length
;
)
{
copy
.
push
.
apply
(
copy
,
copy
.
slice
(
i
,
Math
.
min
(
(
i
+=
chunk
)
,
length
)
)
)
;
}
yield
copy
.
sort
(
(
a
,
b
)
=>
a
-
b
)
;
}
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
toggle
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
error
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
undef
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
result
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
maxOf
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
getMaxOf
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
findMaxOf
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
minOf
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
getMinOf
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
findMinOf
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
array
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
chunk
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
sieve
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML