leetcode_Search in Rotated Sorted Array var search = function(nums, target) { let answer=-1; nums.forEach((element,index)=>{ if(element==target){ answer=index } }) return answer==-1? -1 : answer };