MCPcopy Index your code
hub / github.com/4ian/GDevelop / getAsNumberOrString

Method getAsNumberOrString

GDJS/Runtime/variable.ts:621–624  ·  view source on GitHub ↗

* Get the value of the variable, as a number if it's one, * or as a string (if it's a string or something else) * * In most cases, prefer calling `getAsNumber` or `getAsString` directly. * This is a fallback in case a variable type can't be known statically for sure, * like

()

Source from the content-addressed store, hash-verified

619 * @private
620 */
621 getAsNumberOrString(): number | string {
622 if (this._type === 'number') return this._value;
623 return this.getAsString();
624 }
625
626 /**
627 * Get the value of the variable, considered as a boolean

Callers 1

variable.jsFile · 0.45

Calls 1

getAsStringMethod · 0.95

Tested by

no test coverage detected