Public
Edited
Nov 29, 2022
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.
Learn more