* 查询数组中元素的index * @memberOf module:zrender/core/util
(array, value)
| 460 | * @memberOf module:zrender/core/util |
| 461 | */ |
| 462 | function indexOf(array, value) { |
| 463 | if (array) { |
| 464 | if (array.indexOf) { |
| 465 | return array.indexOf(value); |
| 466 | } |
| 467 | for (var i = 0, len = array.length; i < len; i++) { |
| 468 | if (array[i] === value) { |
| 469 | return i; |
| 470 | } |
| 471 | } |
| 472 | } |
| 473 | return -1; |
| 474 | } |
| 475 | |
| 476 | /** |
| 477 | * 构造类继承关系 |
no test coverage detected