getNumber Method


getNumber(name)

Get the value of a number property by name.

getNumber(name: string): undefined | number

@returns the property's value if it exists and is a number, undefined otherwise.

Parameter Type Description
name string  

Returns - undefined | number

the property's value if it exists and is a number, undefined otherwise.



getNumber(name, defaultValue)

Get the value of a number property by name.

getNumber(name: string, defaultValue: number): number

@returns the property's value if it exists and is a number, otherwise the supplied default value.

Parameter Type Description
name string  
defaultValue number  

Returns - number

the property's value if it exists and is a number, otherwise the supplied default value.


Defined in

Last Updated: 17 December, 2024