Skip to content

Commit 8c65ac8

Browse files
committed
updated
1 parent ec6b5fa commit 8c65ac8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

JavaScript Problem Solving/veryEasy.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ function isLastCharacterN(word) {
2828
}
2929

3030

31+
3132
/*
3233
Check String for Spaces
3334
Create a function that returns true if a string contains any spaces.
@@ -42,6 +43,7 @@ function hasSpaces(str) {
4243
}
4344

4445

46+
4547
/*
4648
Multiply Every Array Item by Two
4749
Create a function that takes an array with numbers and return an array with the elements multiplied by two.
@@ -55,6 +57,7 @@ function getMultipliedArr(arr) {
5557
}
5658

5759

60+
5861
/*
5962
Extract City Facts
6063
Create a function that takes an object as an argument and returns a string with facts about the city. The city facts will need to be extracted from the object's three properties:
@@ -70,6 +73,7 @@ function cityFacts(city) {
7073
}
7174

7275

76+
7377
/*
7478
Add a Consecutive List of Numbers
7579
Write a function that takes the last number of a consecutive list of numbers and returns the total of all numbers up to and including it.
@@ -80,6 +84,7 @@ function addUpTo(n) {
8084
}
8185

8286

87+
8388
/*
8489
Shapes With N Sides
8590
Create a function that takes a whole number as input and returns the shape with that number's amount of sides. Here are the expected outputs to get from these inputs.
@@ -100,4 +105,16 @@ function nSidedShape(n) {
100105
10: "decagon",
101106
}
102107
return shapes[n];
108+
}
109+
110+
111+
112+
/*
113+
Return the Total Number of Parameters
114+
Create a function that returns the total number of parameters passed in.
115+
Note: How can you express the input parameter so it takes a variable number of arguments?
116+
////////////////////////////////////////////////////////////////////
117+
*/
118+
function numberArgs(...args) {
119+
return arguments.length;
103120
}

0 commit comments

Comments
 (0)