T
T
TemaKam2021-09-29 19:53:56
go
TemaKam, 2021-09-29 19:53:56

How to check if an element is in an array without a loop?

How to check if an element is in an array without looping through the array?
something like python "in" is?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Pavlyuk, 2021-09-29
@TemaKam

Not to check in any way, only a cycle.
There are no generics in Go yet, so there are no such functions in the standard library.

S
Stanislav Bodrov, 2021-09-30
@jenki

There is always recursion! Many and different.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question