The the place() operate will return parts from an array that fulfill a sure situation. Let’s discover it with an instance.
I’ll declare an array of grades of some kind (actually arbitrary):
Now you can use the place() to search out, let’s say, all grades which can be larger than three:
Word the way it returns the index place.
The social gathering doesn’t cease right here my buddy, you may present two extra parameters:
- the primary one will substitute values that fulfill the given situation
- the second will, in fact, substitute those who don’t fulfill the situation
As I need to maintain the article concise, I feel that this gives you sufficient to maintain exploring by yourself.