Global Variables
Documentation
The global variable
foo
contains the number of widgets present.
Code
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.
/** The number of widgets present */ declare var foo: number;
Please login to continue.