11// Do not change any of the funcxtion names
22
33const multiplyByTen = ( num ) => {
4+ return num * 10 ;
45 // return num after multiplying it by ten
56 // code here
67} ;
78
89const subtractFive = ( num ) => {
10+ return num - 5 ;
911 // return num after subtracting five
1012 // code here
1113} ;
1214
1315const areSameLength = ( str1 , str2 ) => {
16+ return str1 . length === str2 . length ;
1417 // return true if the two strings have the same length
1518 // otherwise return false
1619 // code here
1720} ;
1821
1922const areEqual = ( x , y ) => {
23+ return x === y ;
2024 // return true if x and y are the same
2125 // otherwise return false
2226 // code here
2327} ;
2428
2529const lessThanNinety = ( num ) => {
30+ if ( num < 90 ) {
31+ return true ;
32+ }
33+ return false ;
2634 // return true if num is less than ninety
2735 // otherwise return false
2836 // code here
2937} ;
3038
3139const greaterThanFifty = ( num ) => {
40+ if ( num > 50 ) {
41+ return true ;
42+ }
43+ return false ;
3244 // return true if num is greater than fifty
3345 // otherwise return false
3446 // code here
3547} ;
3648
3749const add = ( x , y ) => {
50+ return x + y ;
3851 // add x and y together and return the value
3952 // code here
4053} ;
4154
4255const subtract = ( x , y ) => {
56+ return x - y ;
4357 // subtract y from x and return the value
4458 // code here
4559} ;
4660
4761const divide = ( x , y ) => {
62+ return x / y ;
4863 // divide x by y and return the value
4964 // code here
5065} ;
5166
5267const multiply = ( x , y ) => {
68+ return x * y ;
5369 // multiply x by y and return the value
5470 // code here
5571} ;
5672
5773const getRemainder = ( x , y ) => {
74+ return x % y ;
5875 // return the remainder from dividing x by y
5976 // code here
6077} ;
6178
6279const isEven = ( num ) => {
80+ if ( num % 2 === 0 ) {
81+ return true ;
82+ }
83+ return false ;
6384 // return true if num is even
6485 // otherwise return false
6586 // code here
6687} ;
6788
6889const isOdd = ( num ) => {
90+ if ( num % 2 === 0 ) {
91+ return false ;
92+ }
93+ return true ;
6994 // return true if num is false
7095 // otherwise return false
7196 // code here
7297} ;
7398
7499const square = ( num ) => {
100+ return num * num ;
75101 // square num and return the new value
76102 // code here
77103} ;
78104
79105const cube = ( num ) => {
106+ return num * num * num ;
80107 // cube num and return the new value
81108 // code here
82109} ;
83110
84111const raiseToPower = ( num , exponent ) => {
112+ return num ** exponent ;
85113 // raise num to whatever power is passed in as exponent
86114 // code here
87115} ;
88116
89117const roundNumber = ( num ) => {
118+ return Math . round ( num ) ;
90119 // round num and return it
91120 // code here
92121} ;
93122
94123const roundUp = ( num ) => {
124+ return Math . ceil ( num ) ;
95125 // round num up and return it
96126 // code here
97127} ;
98128
99129const addExclamationPoint = ( str ) => {
130+ // return str + '!';
131+ return str += '!' ;
100132 // add an exclamation point to the end of str and return the new string
101133 // 'hello world' -> 'hello world!'
102134 // code here
103135} ;
104136
105137const combineNames = ( firstName , lastName ) => {
138+ return `${ firstName } ${ lastName } ` ;
106139 // return firstName and lastName combined as one string and separated by a space.
107140 // 'Lambda', 'School' -> 'Lambda School'
108141 // code here
142+ // var greeting = `Hello ${ prefix } ${ firstName } ${ lastName }!`;
109143} ;
110144
111145const getGreeting = ( name ) => {
146+ return `Hello ${ name } !` ;
112147 // Take the name string and concatenate other strings onto it so it takes the following form:
113148 // 'Sam' -> 'Hello Sam!'
114149 // code here
@@ -117,21 +152,25 @@ const getGreeting = (name) => {
117152// If you can't remember these area formulas then head over to Google or look at the test code.
118153
119154const getRectangleArea = ( length , width ) => {
155+ return length * width ;
120156 // return the area of the rectangle by using length and width
121157 // code here
122158} ;
123159
124160const getTriangleArea = ( base , height ) => {
161+ return 0.5 * base * height ;
125162 // return the area of the triangle by using base and height
126163 // code here
127164} ;
128165
129166const getCircleArea = ( radius ) => {
167+ return Math . PI * radius * radius ;
130168 // return the rounded area of the circle given the radius
131169 // code here
132170} ;
133171
134172const getRectangularPrismVolume = ( length , width , height ) => {
173+ return width * height * length ;
135174 // return the volume of the 3D rectangular prism given the length, width, and height
136175 // code here
137176} ;
0 commit comments