Skip to content
New issue

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

Documentation: array_first/array_last will return "undefined" if the array is empty #6104

Closed
VacantShade opened this issue Jun 3, 2024 · 2 comments
Assignees
Labels
docs-bug GameMaker Manual Bugs
Milestone

Comments

@VacantShade
Copy link

VacantShade commented Jun 3, 2024

Description

Using array_first or array_last on an empty array will return undefined, 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

@VacantShade VacantShade added the docs-bug GameMaker Manual Bugs label Jun 3, 2024
@jackerley jackerley moved this from Triage to Todo in Team Workload Jun 4, 2024
YYBartT added a commit to YoYoGames/GameMaker-Manual that referenced this issue Jun 20, 2024
…array is empty

YoYoGames/GameMaker-Bugs#6104

Added that undefined is returned in case the array is empty
@YYBartT
Copy link

YYBartT commented Jun 20, 2024

Added that undefined is returned if the array is empty on both function pages.

@YYBartT YYBartT moved this from Todo to Ready for QA in Team Workload Jun 20, 2024
@YYBartT YYBartT closed this as completed Mar 6, 2025
@github-project-automation github-project-automation bot moved this from Ready for QA to Done in Team Workload Mar 6, 2025
@YYBartT YYBartT added this to the 2024.13 milestone Mar 6, 2025
@YYBartT YYBartT moved this from Done to Ready for QA in Team Workload Mar 6, 2025
@mgeddesGM
Copy link

verified in latest beta manual

@mgeddesGM mgeddesGM moved this from Ready for QA to Verified in Team Workload Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-bug GameMaker Manual Bugs
Projects
Status: Verified
Development

No branches or pull requests

4 participants