Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed array: contains method #20951

Closed
2 tasks
enghitalo opened this issue Mar 3, 2024 · 1 comment
Closed
2 tasks

fixed array: contains method #20951

enghitalo opened this issue Mar 3, 2024 · 1 comment
Labels
Feature Request This issue is made to request a feature.

Comments

@enghitalo
Copy link
Contributor

enghitalo commented Mar 3, 2024

Describe the feature

const arr = [1, 2, 3]!
assert arr.contains(3) == true
assert arr.contains(4) == false

Use Case

same that dynamic arrays

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Version used

V 0.4.4

Environment details (OS name and version, etc.)

all

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@enghitalo enghitalo added the Feature Request This issue is made to request a feature. label Mar 3, 2024
@enghitalo enghitalo changed the title fixed array: contains method fixed array: contains method Mar 3, 2024
@felipensp
Copy link
Member

You already can do it via in operator.

fn main() {
	a := [1,2,3]!
	if 2 in a {
		dump(a)
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request This issue is made to request a feature.
Projects
None yet
Development

No branches or pull requests

2 participants