Skip to content

Commit 1a5bc65

Browse files
committed
Rename exercise function for clarity
1 parent d578ee7 commit 1a5bc65

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/exercises/08-more-arrays-exercises.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,19 +166,19 @@ The following lines should help test if your function works correctly. They shou
166166

167167
process.stdout.write('\n*8·34.\n');
168168
/*
169-
*8·34. Create a function called 'makeSquares' that takes an array of numbers and returns an array of squares. A square is an array of two numbers: [length, width].
169+
*8·34. Create a function called 'makeRectangles' that takes an array of numbers and returns an array of rectangles, where a rectangle is an array of two numbers: [length, width].
170170
171171
The following lines should help test if your function works correctly. They should print true.
172172
*/
173173

174174

175-
// console.log('makeSquares tests');
175+
// console.log('makeRectangles tests');
176176
// console.log(eqArrays(
177-
// makeSquares([1, 2, 3, 4]),
177+
// makeRectangles([1, 2, 3, 4]),
178178
// [ [1, 1], [2, 2], [3, 3], [4, 4] ]
179179
// ));
180180
// console.log(eqArrays(
181-
// makeSquares([-1, 0, 99, 1000]),
181+
// makeRectangles([-1, 0, 99, 1000]),
182182
// [ [-1, -1], [0, 0], [99, 99], [1000, 1000] ]
183183
// ));
184184

src/exercises/08-more-arrays-solutions.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,19 +247,19 @@ console.log(eqArrays(
247247

248248
process.stdout.write('\n*8·34.\n');
249249
/*
250-
*8·34. Create a function called 'makeSquares' that takes an array of numbers and returns an array of squares. A square is an array of two numbers: [length, width].
250+
*8·34. Create a function called 'makeRectangles' that takes an array of numbers and returns an array of rectangles, where a rectangle is an array of two numbers: [length, width].
251251
252252
The following lines should help test if your function works correctly. They should print true.
253253
*/
254-
const makeSquares = xs => xs.map(x => [x, x]);
254+
const makeRectangles = xs => xs.map(x => [x, x]);
255255

256-
console.log('makeSquares tests');
256+
console.log('makeRectangles tests');
257257
console.log(eqArrays(
258-
makeSquares([1, 2, 3, 4]),
258+
makeRectangles([1, 2, 3, 4]),
259259
[ [1, 1], [2, 2], [3, 3], [4, 4] ]
260260
));
261261
console.log(eqArrays(
262-
makeSquares([-1, 0, 99, 1000]),
262+
makeRectangles([-1, 0, 99, 1000]),
263263
[ [-1, -1], [0, 0], [99, 99], [1000, 1000] ]
264264
));
265265

0 commit comments

Comments
 (0)