Minecraft wiki entry for scoreboard, associated text: Syntax
scoreboard objectives add <objective> <criteria> [<displayName>] (Java Edition)
scoreboard objectives add <objective: string> dummy [displayName: string] (Bedrock Edition)
Description
Create a new objective with the given internal objective name, specified criterion, and the optional display name.
Arguments
JE: <objective>: string
BE: objective: string: basic_string
Specifies the internal objective name.
Must be a string. In Java Edition, it must be in a single word (Allowed characters include: -, +, ., _, A-Z, a-z, and 0-9). In Bedrock Edition, it must be either a single word that isn't a number (allowed characters: -, :, ., _, A-Z, a-z, and 0-9) or a double-quoted string.
JE: <criteria>: objective_criteria
BE: dummy
Specifies the criterion of the new objective.
Must be a scoreboard objective criterion. In Bedrock Edition, "dummy" is the only criterion currently supported.
JE: <displayName>: component
BE: displayName: string: basic_string
Specifies the display name, defaulting to <objective> when unspecified.
In Java Edition, must be a raw JSON text. In Bedrock Edition, it must be either a single word that isn't a number (allowed characters: -, :, ., _, A-Z, a-z, and 0-9) or a double-quoted string.
Result
Command Trigger Java Edition Bedrock Edition
... add ... the arguments are not specified correctly Unparseable Failed
<objective> already exists Failed
On success Create a new objective.
Output
Command Edition Situation Success Count /execute store success ... /execute store result ...
... add ... Java Edition On fail 0 0 0
On success 1 1 the number of objectives in scoreboard system after execution
Bedrock Edition On fail 0 N/A N/A
On success 1 N/A N/A