From d317b4f7c64c4841e8c0449b9dada41bb2abb12d Mon Sep 17 00:00:00 2001 From: Yuliia Mustafina <71671138+Mustafina1990@users.noreply.github.com> Date: Tue, 18 Oct 2022 11:40:11 +0200 Subject: [PATCH] add functions --- 2-js-basics/2-functions-methods/assignment.md | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/2-js-basics/2-functions-methods/assignment.md b/2-js-basics/2-functions-methods/assignment.md index 4fbe387d..fc27789d 100644 --- a/2-js-basics/2-functions-methods/assignment.md +++ b/2-js-basics/2-functions-methods/assignment.md @@ -8,6 +8,27 @@ See if you can create a function that has a mix of parameters and parameters wit ## Rubric +`function checkAge(name, surname, age) { + const userName = name; + const userSurname = surname; + const userAge = age; + + if (age > 18) { + return console.log( + `Hello ${name} ${surname}! You ready for work! Good luck!` + ); + } else { + return console.log( + `Hello ${name} ${surname}, sorry you too small for this project` + ); + } + } + + function addNumbers(a, b = 10) { + const result = a + b; + console.log(result); + }` + | Criteria | Exemplary | Adequate | Needs Improvement | | -------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ----------------- | -| | Solution is offered with two or more well-performing functions with diverse parameters | Working solution is offered with one function and few parameters | Solution has bugs | \ No newline at end of file +| | Solution is offered with two or more well-performing functions with diverse parameters | Working solution is offered with one function and few parameters | Solution has bugs |