From d434e330d0b7c5d3d36224554a359a9078dc80ff Mon Sep 17 00:00:00 2001 From: lucas Date: Sat, 4 Nov 2023 21:10:42 -0300 Subject: [PATCH] feat: added structure for modern js lessons --- modern-javascript/main.js | 4 ++++ modern-javascript/scripts/functions.js | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100644 modern-javascript/main.js create mode 100644 modern-javascript/scripts/functions.js diff --git a/modern-javascript/main.js b/modern-javascript/main.js new file mode 100644 index 0000000..df5cc03 --- /dev/null +++ b/modern-javascript/main.js @@ -0,0 +1,4 @@ +import sum from './scripts/functions.js' + +console.log(sum(1, 2)) + diff --git a/modern-javascript/scripts/functions.js b/modern-javascript/scripts/functions.js new file mode 100644 index 0000000..b27a870 --- /dev/null +++ b/modern-javascript/scripts/functions.js @@ -0,0 +1,8 @@ +// Cenário 1 - this em uma função normal + +export default function sum(a, b) { + console.log(this) + console.log(arguments) + return a + b +} +