kot536522,
1.
<script>
let b = [1, 2, 33, 4, 5, 6, 3, -5, 8, 33];
function fn(b)
{
let a = b.slice(0);
let min = Math.min(...a);
let max = Math.max(...a);
min = a.indexOf(min);
max = a.indexOf(max);
min > max && ([min,max] = [max,min]);
min++;
max = a.splice(min,max-min).reverse();
a.splice(min,0,...max);
return a
}
document.write(JSON.stringify(fn(b), "", 4)+"<br>");
document.write(JSON.stringify(b, "", 4));
</script>