Sumar Arrays JavaScript

Tengo un array y necesito una función que sume todos los elementos del array excepto el mayor y el menor, lo que se me ocurre primero es ordenarlos, pero de hay no se que exactamente como seguir, este es mi código:

const array=[ 6,2,1,8,10]
function sumArray(array){
array.sort(function(a,b){return a - b})
return array
var total= array.reduce(function(a, b)
{ return a + b; });
return total

sumArray(array) // 16 it’s work¡

Assuming that all of the numbers in the array are unique, you are removing the smallest and largest correctly. Now you need to add the remaining numbers in the array together and return that sum. There are many ways to do this. If you know what a for loop is you could use that. There is also an array method that will help you reduce the array down to a single value.

I have a solution thanks for all¡