Global Variables
Documentation
The global variable
foo
contains the number of widgets present.
Code
1 | console.log( "Half the number of widgets is " + (foo / 2)); |
Declaration
Use declare var
to declare variables. If the variable is read-only, you can use declare const
. You can also use declare let
if the variable is block-scoped.
1 2 | /** The number of widgets present */ declare var foo: number; |
Please login to continue.