Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

namespaces typescript

/*
The namespace is used for logical grouping of functionalities. 
A namespace can include interfaces, classes, functions and variables 
to support a single or a group of related functionalities.
*/

namespace Vehicle {
  const name = "Toyota"
  export function getName () {
      return `${name}`
  }
}

Vehicle.getName() //Toyota
 
PREVIOUS NEXT
Tagged: #namespaces #typescript
ADD COMMENT
Topic
Name
7+4 =