var myStr = new String("hello world");
document.write(myStr.slice(3) + "<br/>");//lo world
document.write(myStr.substring(3), "<br />"); //lo world
document.write(myStr.slice(3, 7), "<br />"); //output lo w
document.write(myStr.substring(3, 7), "<br/>"); //output lo w
document.write(myStr.slice(-3), "<br/>"); //output rld
document.write(myStr.substring(-3), "<br/>"); //output hello world 负数相当于0
document.write(myStr.slice(3, -4), "<br/>"); //相当于slice(3,7)output lo w
document.write(myStr.substring(3, -4), "<br />"); //output hel 相当于substring(0,3)较小的数字放在第一个参数