Objects with Properties
Documentation
The global variable
myLibhas a functionmakeGreetingfor creating greetings, and a propertynumberOfGreetingsindicating 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.