Namespace in typescript | Thiru Academy

Опубликовано: 24 Октябрь 2024
на канале: Thiru Academy
154
4

Follow me :    / channel  

Namespaces in typescript:
A namespace in TypeScript is a way to organize code into logical groups and avoid naming collisions between identifiers. Namespaces are simply named JavaScript objects in the global namespace.
Ex:

namespace myNamespace{
export class class1{}
export class class2{}
}
var obj:myNamespace.class1 = new myNamespace.class1()