Bindings for Array.prototype.findIndex()

This commit is contained in:
Tomohide Takao
2018-07-14 19:09:40 +09:00
parent 696678b8cc
commit f5035c3841
2 changed files with 46 additions and 0 deletions

View File

@ -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.
///