We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using array_first or array_last on an empty array will return undefined, rather than resulting in a crash.
array_first
array_last
undefined
This behavior is fine, but maybe should be documented so it is clear if this is intended or not? Something like:
"RETURNS: Any (Any valid data type that an array can hold) or undefined if the array is empty"
https://manual.gamemaker.io/monthly/en/#t=GameMaker_Language%2FGML_Reference%2FVariable_Functions%2Farray_first.htm
https://manual.gamemaker.io/monthly/en/#t=GameMaker_Language%2FGML_Reference%2FVariable_Functions%2Farray_last.htm
The text was updated successfully, but these errors were encountered:
docs(general): array_first/array_last will return "undefined" if the …
890106a
…array is empty YoYoGames/GameMaker-Bugs#6104 Added that undefined is returned in case the array is empty
Added that undefined is returned if the array is empty on both function pages.
Sorry, something went wrong.
verified in latest beta manual
YYBartT
No branches or pull requests
Description
Using
array_first
orarray_last
on an empty array will returnundefined
, rather than resulting in a crash.This behavior is fine, but maybe should be documented so it is clear if this is intended or not?
Something like:
"RETURNS:
Any (Any valid data type that an array can hold) or undefined if the array is empty"
Manual Link
https://manual.gamemaker.io/monthly/en/#t=GameMaker_Language%2FGML_Reference%2FVariable_Functions%2Farray_first.htm
https://manual.gamemaker.io/monthly/en/#t=GameMaker_Language%2FGML_Reference%2FVariable_Functions%2Farray_last.htm
The text was updated successfully, but these errors were encountered: