str[i];
slice(startIndex,endIndex) (开始下标,结束下标)
substr(index,length) (下标处开始,长度)
subString(startIndex,endIndex) (开始下标,结束下标不包含此)
<body><script>var str ="hello";console.log(str[0]); //hconsole.log(str.slice(0)); //hello</script></body>
<body><script>var str ="hello";console.log(str.substr(0,3)); //helconsole.log(str.substring(0,2)); //he</script></body>
