From 338a563f11ddcc663c1051f3f17441055995720e Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 2 Jul 2024 16:34:09 +0100 Subject: [PATCH] Remove the repetition from the hello world example --- app.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app.ts b/app.ts index 2a97505..17db08b 100644 --- a/app.ts +++ b/app.ts @@ -1,6 +1,8 @@ -console.log("hello world"); -console.log("nice to meet you!!"); -console.log("hello world"); -console.log("nice to meet you!!"); -console.log("hello world"); -console.log("nice to meet you!!"); +function printMessages() { + console.log("hello world"); + console.log("nice to meet you!!"); +} + +printMessages(); +printMessages(); +printMessages();