æç®åçå®ç°æ¹å¼ï¼å¾ªç¯ä¸éå°±å¯ä»¥äºã
ä¸é¢æ¯ç®åçå°ä¾åï¼
<script>
var arr = ['asdf','bsdfs','csdfsd','dasdfs','egdfhd'];
var locationArr = [];
for(var i=0;i<arr.length;i++){
if(arr[i].indexOf('csdf') >= 0){
locationArr.push(i);
}
}
console.log(locationArr); //è¿ä¸ªlocationArréé¢åè´®çå°±æ¯ææåºç°
å符串çæ°ç»ä¸çä½ç½®äºã
</script>