Type checking: why do some types have a '?' after them

I am currently learning what’s called “type notation.” Recently, while I was scripting, I was using the type “number,” but there was also the type “number?” list underneath it. Could anyone explain to me what the difference is with the question mark?
This is what I was coding and the fill in suggestion (“pageSize:number?”) that Roblox Studio gave me:

1 Like

A type declaration followed by a question mark means that the argument/variable is optional.

It’s mentioned in the documentation here: Syntax - Luau

2 Likes

A ‘?’ just means that an argument doesn’t have to be specified.

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.