1 line change, 12x speed improvement - Why profiling is important!

Sometimes it's the most unexpected lines of code that contributes to slow performance. Take this line for example;
⛶[this.heapArray[j], this.heapArray[k]] = [this.heapArray[k], this.heapArray[j]];Ni...