From 2e3b22c937bbeb8fc92b4a97e8b5752cfd04295e Mon Sep 17 00:00:00 2001 From: rig-maintainer <maintainer@example.com> Date: Thu, 2 Jul 2026 20:08:05 -0400 Subject: [PATCH] feat: accept an optional name argument --- hello.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hello.js b/hello.js index f8535a9..7ab437c 100644 --- a/hello.js +++ b/hello.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -function greet() { - return "Hello, world!"; +function greet(name = "world") { + return `Hello, ${name}!`; } -if (require.main === module) console.log(greet()); +if (require.main === module) console.log(greet(process.argv[2])); module.exports = { greet }; -- 2.43.0
LGTM — default stays "world", arg path tested locally. Merging.
← All patches and pull requests
LGTM — default stays "world", arg path tested locally. Merging.