Given an array of integers nums sorted in ascending order, find the starting and ending position of a given targetvalue.Your algorithm's runtime complexity must be in the order of O(log n). If the target is not found in the array, return [-1, -1]. Ex…
1.获得对象在数组中的下标 function (_arr,_obj) { var len = _arr.length; for(var i = 0; i < len; i++){ if(_arr[i] == _obj){ return parseInt(i); } } return -1; }; 符号“==”可以判断是否是同一个对象 2.删除指定的某个对象元素 function (_arr,_obj) { var length = _arr.length; for(var i = 0; i <…