Global Variables

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;
doc_TypeScript
2016-10-04 19:25:15
Comments
Leave a Comment

Please login to continue.