Skip to content

Added support for array.find#730

Merged
Perryvw merged 2 commits intomasterfrom
feature/array-find
Oct 5, 2019
Merged

Added support for array.find#730
Perryvw merged 2 commits intomasterfrom
feature/array-find

Conversation

@Perryvw
Copy link
Copy Markdown
Member

@Perryvw Perryvw commented Oct 3, 2019

Somehow we missed this and never noticed, but now it's in.

@@ -0,0 +1,14 @@
// https://www.ecma-international.org/ecma-262/10.0/index.html#sec-array.prototype.find
function __TS__ArrayFind<T>(this: void, arr: T[], callbackFn: (element: T, index?: number, array?: T[]) => boolean): T {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function __TS__ArrayFind<T>(this: void, arr: T[], callbackFn: (element: T, index?: number, array?: T[]) => boolean): T {
function __TS__ArrayFind<T>(this: void, arr: T[], callbackFn: (element: T, index: number, array: T[]) => unknown): T {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and the return type should probably be T | undefined

@Perryvw Perryvw merged commit de818bc into master Oct 5, 2019
@Perryvw Perryvw deleted the feature/array-find branch October 5, 2019 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants