From e772bb5086672cf56315fff0741f13c72da04b5f Mon Sep 17 00:00:00 2001 From: Sergey Krylov Date: Sat, 3 May 2025 16:03:48 +0300 Subject: [PATCH] add sum function --- functions.js | 5 +++++ test.js | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 functions.js diff --git a/functions.js b/functions.js new file mode 100644 index 0000000..849a2a1 --- /dev/null +++ b/functions.js @@ -0,0 +1,5 @@ +function sum(a, b) { + return a + b; +} + +module.exports = { sum }; diff --git a/test.js b/test.js index 8a4fc14..310b5f0 100644 --- a/test.js +++ b/test.js @@ -1,2 +1,6 @@ +// import { sum } from "./functions"; +const { sum } = require("./functions"); const a = 22; -console.log('sum', a); \ No newline at end of file +const b = 23; + +console.log("sum", sum(a, b)); -- 2.47.2