I'm beginner to programming/stackoverflow and trying to create a function that sum elements of an array, without the lowest and highest elements.
So I decided to sort the array using ascending order and splice it to remove first and last values. Figured out that this was going to be the easiest way.
But now I have spent literally hours trying to debug it, watched several youtube videos and tried every array.reduce variant I could imagine and find on the internet, trying to under-****ing-stand array.reduce function and why it is not returning reduced array.
Could someone help me? By the way, if someone knows any ways to splice two values from an array without using array.splice two times, I would love to know. Thank you so much.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…