You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: JavaScript Problem Solving/veryEasy.js
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@ function isLastCharacterN(word) {
28
28
}
29
29
30
30
31
+
31
32
/*
32
33
Check String for Spaces
33
34
Create a function that returns true if a string contains any spaces.
@@ -42,6 +43,7 @@ function hasSpaces(str) {
42
43
}
43
44
44
45
46
+
45
47
/*
46
48
Multiply Every Array Item by Two
47
49
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) {
55
57
}
56
58
57
59
60
+
58
61
/*
59
62
Extract City Facts
60
63
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) {
70
73
}
71
74
72
75
76
+
73
77
/*
74
78
Add a Consecutive List of Numbers
75
79
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) {
80
84
}
81
85
82
86
87
+
83
88
/*
84
89
Shapes With N Sides
85
90
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) {
100
105
10: "decagon",
101
106
}
102
107
returnshapes[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?
0 commit comments