function shellSort(arr) {
if (!Array.isArray(arr)) {
throw TypeError('arr must be an array')
// len >> 1 === Math.floor(len / 2)
for (let step = len >> 1; step > 0; step >>= 1) {
for (let i = step; i < len; ++i) {
for (j = i - step; j >= 0 && arr[j] > tmp; j -= step) {