utilityfunctions.ts 437 B

123456789101112131415161718192021
  1. namespace Utility {
  2. export namespace Fees {
  3. export function CalculateLateFees(daysLate: number): number {
  4. return daysLate * 0.25;
  5. }
  6. }
  7. export function MaxBooksAllowed(age: number): number {
  8. if (age < 12) {
  9. return 3;
  10. }
  11. else {
  12. return 10;
  13. }
  14. }
  15. // Since it is not exported, it will be private to the namespace.
  16. function privateFunc(): void {
  17. console.log('This is private...');
  18. }
  19. }