Skip to main content

ParameterVariable pass into function to define Function Signature, imports Arguments & act as local variable

aka Param

!differs vs Argument which only the value itself entering function - and not a name used to define function

!differs vs Argument which is what Parameter will initialize into, if supplied

Parameter Default Value

JS Syntax used to specify default Value for a Parameter if not provided

References

  1. functionJS Keyword to Declare function (with optional Argument Parameters)

  2. ArgumentValue import as Parameter input to function

  3. Parameter Default ValueJS Syntax used to specify default Value for a Parameter if not provided

  4. Typed Optional ParameterTS Syntax to mark Identifier as an optional Parameter using ?:

  5. --noImplicitAny ↔ to flag TSC to prevent Type Inference for any - enforce explicit Type for Parameter, Exception, etc

  6. Type Assignment ↔ code to assign Type to Variable/Parameter using :

  7. assert.throws()assert Static Method to complain if Callback Function Parameter does not throw Exception

  8. "noImplicitAny": true ↔ to throw Exception when any Parameter inferred as any

  9. "noUnusedParameters": true ↔ to warn/throw when function Parameter unused (inside function)

  10. Lazy Initial valuefunction pass as Parameter into useState(), to assign return value as Initial State value, on first-call only

  11. useToggle()Custom Hook to flip boolean Param

  12. RangeErrorException when number || Param outside valid range