mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-26 03:01:33 +00:00
Bindings for Array.prototype.findIndex()
This commit is contained in:
@ -172,6 +172,13 @@ extern "C" {
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn find(this: &Array, predicate: &mut FnMut(JsValue, u32, Array) -> bool) -> JsValue;
|
||||
|
||||
/// The findIndex() method returns the index of the first element in the array that
|
||||
/// satisfies the provided testing function. Otherwise -1 is returned.
|
||||
///
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex
|
||||
#[wasm_bindgen(method, js_name = findIndex)]
|
||||
pub fn find_index(this: &Array, predicate: &mut FnMut(JsValue, u32, Array) -> bool, this_arg: &JsValue) -> u32;
|
||||
|
||||
/// The includes() method determines whether an array includes a certain
|
||||
/// element, returning true or false as appropriate.
|
||||
///
|
||||
|
Reference in New Issue
Block a user