range should be optional

may i ask you to remove the first expression, then let it be `if (range.length == 0) {`, thanks