Skip to content

Latest commit

 

History

History
 
 

9.1

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Exercise 9.1: Contain your excitement

Your job here is to write a generic function ContainsFunc that operates on slices of arbitrary type. Given a function argument, ContainsFunc should return true if the function returns true for any element in the slice, or false otherwise.

For example:

s := []rune{'a', 'B', 'c'}
fmt.Println(ContainsFunc(s, unicode.IsUpper))
// true

See Solution 9.1 if you'd like something to compare with your answer.


Index - Next