The What
Description
The next
function does two tasks:
- It moves the array’s internal pointer to the next element in the array, i.e. increments it one position.
- Then it returns the element’s value at the new position.
If the internal pointer is not pointing a valid element (it’s out-of-bounds), then false is returned.
Show It in ActionBasic
In this video, you will see the next
function in action through various code examples.
Your functions are bloated. Put them on a diet. Think "skinny" and "as few lines as possible."
Go DeepPro
In this video, you will go deeper into the instruction. Let’s take a deep look at the next
function.