Namespaces are a way of logically grouping related code. This is a logical organization and doesn’t affect the runtime in any way.

namespace MyNamespace {
    export const myValue: number = 10;


Create a namespace named Geometry. Inside this namespace, define two functions - one to calculate the area of a rectangle, and another for the area of a circle.

Copyright © Read our Terms of Use and Privacy Policy