mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-21 08:41:35 +00:00
Merge pull request #397 from ZerothLaw/Issue275/ArrayFind
Issue #275: Added Array.prototype.find binding
This commit is contained in:
@ -141,6 +141,13 @@ extern "C" {
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn filter(this: &Array, predicate: &mut FnMut(JsValue, u32, Array) -> bool) -> Array;
|
||||
|
||||
/// The `find()` method returns the value of the first element in the array that satisfies
|
||||
/// the provided testing function. Otherwise `undefined` is returned.
|
||||
///
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn find(this: &Array, predicate: &mut FnMut(JsValue, u32, Array) -> bool) -> JsValue;
|
||||
|
||||
/// The includes() method determines whether an array includes a certain
|
||||
/// element, returning true or false as appropriate.
|
||||
///
|
||||
|
Reference in New Issue
Block a user