indexOf的第2个参数 javascript

树上这样写的Optionally, you can specify where in the main string the hould begin—but the returned value is always relative to the very first characsearch ster of the main string.
就是说第2个可选参数决定了搜索的起始位置,那么
"012345".indexOf("3",4)的结果是3,不应该啊,因为搜索是从4开始的,怎么会搜索到3呢??请教各位高手

第1个回答  2014-05-28
很显然你需要再执行一遍,是-1
相似回答
大家正在搜