v1
- by pushkine 8/28/202200
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
function map(data, fn) {
	for (var i = 0, mapped = []; i < data.length; ++i) mapped[i] = fn(data[i], i);
	return mapped;
}
function create_array(){
	return Array.from({length: Math.floor(Math.random() * 30)}, () => Math.random());
}
function map_fn(value, index) {
	return index + value ** 2;
}
var r = 0;
delete caserun single casemove downdrag and drop case


ready



const target = create_array();
const arr = [];
for(var i = 0; i < target.length; i++) {
	arr[i] = i + target[i] ** 2;
}
r += Math.max(...arr);
delete caserun single casemove upmove downdrag and drop case


ready



r += Math.max(...map(create_array(), map_fn));
delete caserun single casemove updrag and drop case


ready



r += Math.max(...create_array().map(map_fn));
Test Case - click to add another test case
Teardown JS - click to add teardown JavaScript
Output (DOM) - click to monitor output (DOM) while test is running
RUN