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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more