UNPKG
vimo-dt
Version:
latest (1.0.4)
1.0.4
1.0.2
1.0.1
0.10.0
A Vue2.x UI Project For Mobile & HyBrid
github.com/vm-component/vimo
vm-component/vimo
vimo-dt
/
src
/
util
/
remove-array-item.js
13 lines
(12 loc)
•
272 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
/** * 移除array中的某个item *
@param
{any} array *
@param
{any} item *
@private
*/
export
default
function
removeArrayItem
(
array
, item
)
{
const
index
=
array
.
indexOf
(item)
// ~index => index*(-1)-1
// ~-1 => 0
return
~index &&
array
.
splice
(index,
1
) }