mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-21 08:41:35 +00:00
Issue #275: Added Array.prototype.find binding
This commit is contained in:
@ -134,6 +134,7 @@ extern "C" {
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn fill(this: &Array, value: JsValue, start: u32, end: u32) -> Array;
|
||||
|
||||
|
||||
/// The `filter()` method creates a new array with all elements that pass the
|
||||
/// test implemented by the provided function.
|
||||
///
|
||||
@ -141,6 +142,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