Skip to content

Commit 6f3e3fd

Browse files
Update JSDoc types from function to CallbackType
1 parent 5e92916 commit 6f3e3fd

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

exercises/concept/coordinate-transformation/coordinate-transformation.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export function scale2d(sx, sy) {
4040
* Create a composition function that returns a function that combines two
4141
* functions to perform a repeatable transformation
4242
*
43-
* @param {function} f the first function to apply
44-
* @param {function} g the second function to apply
43+
* @param {CallbackType} f the first function to apply
44+
* @param {CallbackType} g the second function to apply
4545
*
4646
* @returns {CallbackType} a function which takes an x, y parameter, returns the
4747
* transformed coordinate pair in the form [x, y]
@@ -54,11 +54,12 @@ export function composeTransform(f, g) {
5454
* Return a function that memoizes the last result. If the arguments are the same as the last call,
5555
* then memoized result returned.
5656
*
57-
* @param {function} f the transformation function to memoize, assumes takes two arguments 'x' and 'y'
57+
* @param {CallbackType} f the transformation function to memoize, assumes takes two arguments 'x' and 'y'
5858
*
5959
* @returns {CallbackType} a function which takes x and y arguments, and will either return the saved result
6060
* if the arguments are the same on subsequent calls, or compute a new result if they are different.
6161
*/
6262
export function memoizeTransform(f) {
63+
// if you have type error for callback function. Add `/** @type {[number, number]} */` to the return variable.
6364
throw new Error('Remove this line and implement the function');
6465
}

0 commit comments

Comments
 (0)