Objects with Properties
Documentation
The global variable
myLib
has a functionmakeGreeting
for creating greetings, and a propertynumberOfGreetings
indicating the number of greetings made so far.
Code
let result = myLib.makeGreeting("hello, world"); console.log("The computed greeting is:" + result); let count = myLib.numberOfGreetings;
Declaration
Use declare namespace
to describe types or values accessed by dotted notation.
declare namespace myLib { function makeGreeting(s: string): string; let numberOfGreetings: number; }
Please login to continue.