From 720a518a282ccde13ab619cd77daf129362cb4fe Mon Sep 17 00:00:00 2001 From: ardaninsaturnu Date: Mon, 2 May 2022 20:17:08 +0300 Subject: [PATCH] function --- 01_Day_JavaScript_Refresher/main.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/01_Day_JavaScript_Refresher/main.js b/01_Day_JavaScript_Refresher/main.js index 335d1e3..0157281 100644 --- a/01_Day_JavaScript_Refresher/main.js +++ b/01_Day_JavaScript_Refresher/main.js @@ -51,4 +51,21 @@ countries.length % 2 === 0 ? console.log(countries.slice( 0,6 ),countries.slice( 6,12 )); +function printFullName() { + let firstName = 'Asabeneh' + let lastName = 'Yetayehahuha' + let space = ' ' + let fullName = firstName + space + lastName +} + +console.log(printFullName()); + +function sumAllNums() { + let sum = 0; + for( let i = 0; i < arguments.length; i++ ){ + sum += arguments[i]; + } + return sum; +} +console.log(sumAllNums( 1,2,3,4,5,10,7,8,9,10 ))