let arr = ['jack','tom','lucy','mack']
let str = 'tom' 
let index = arr.findIndex(item => item == str); //根据 已知str  获取在数组中的位置(index);