Update assignment.md

assignment on functions
pull/701/head
Andazi Boboye 3 years ago committed by GitHub
parent 51db10da27
commit c8c7aded93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,8 +4,33 @@
Create different functions, both functions that return something and functions that don't return anything.
#1 returns random number 1 -100
function randomNumber(){
return Math.floor(Math.random() * 100) + 1;
}
randomNumber();
#2 does not return anything
function randomNumber(){
}
randomNumber();
See if you can create a function that has a mix of parameters and parameters with default values.
#1
function greet(firstName, lastName){
return `Hey there, ${firstName} ${lastName}`;
}
greet('Boboye', 'Andazi');
#2
function greet(firstName, lastName = 'Ford'){
return `Hey there, ${firstName} ${lastName}`;
}
greet('Boboye');
greet('Boboye', 'Manny');
## Rubric
| Criteria | Exemplary | Adequate | Needs Improvement |

Loading…
Cancel
Save