-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunctions_practice
More file actions
21 lines (11 loc) · 1.5 KB
/
functions_practice
File metadata and controls
21 lines (11 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// 1. Write a function that takes in a number and returns the number times two. Then run the function and print the result.
// 2. Write a function that takes in a string and returns the string with all capital letters. Then run the function and print the result.
// 3. Write a function that takes in two numbers and returns the first number subtracted by the second. Then run the function and print the result.
// 4. Write a function that takes in a number and returns the number times itself. Then run the function and print the result.
// 5. Write a function that takes in a string and returns the first letter of the string. Then run the function and print the result.
// 6. Write a function that takes in three strings and returns a string that combines all three strings with spaces in between. Then run the function and print the result.
// 7. Write a function that takes in a number and returns the number as a string. Then run the function and print the result.
// 8. Write a function that takes in a string and returns the string repeated 5 times. Then run the function and print the result.
// 9. Write a function that takes in 3 numbers and returns the average(the sum divided by 3.0). Then run the function and print the result.
// 10. Write a function that takes in a number and returns the number times 10 plus 30. Then run the function and print the result.
// SOLUTIONS KEY: https://github.com/TaylorOD/Deliberate_Practice-JavaScript/blob/master/solution_key/functions_practice_solutions.js