--- id: 6449842c6f6c84261075e4c9 title: Step 34 challengeType: 0 dashedName: step-34 --- # --description-- In your `evalFormula`, declare an `idToText` arrow function which takes an `id` parameter. Your `idToText` function should return the result of calling `.find()` on the `cells` array with a callback function that takes an `cell` parameter and returns `cell.id === id`. Both of your functions should use implicit returns. # --hints-- You should declare an `idToText` variable in your `evalFormula` function. ```js assert.match(code, /const\s+evalFormula\s*=\s*\(\s*x\s*,\s*cells\s*\)\s*=>\s*{\s*(?:const|let|var)\s+idToText/); ``` You should use `const` to declare your `idToText` variable. ```js assert.match(code, /const\s+evalFormula\s*=\s*\(\s*x\s*,\s*cells\s*\)\s*=>\s*{\s*const\s+idToText/); ``` Your `idToText` variable should be an arrow function. ```js assert.match(code, /const\s+evalFormula\s*=\s*\(\s*x\s*,\s*cells\s*\)\s*=>\s*{\s*const\s+idToText\s*=\s*(\([^)]*\)|[^\s()]+)\s*=>/); ``` Your `idToText` function should have an `id` parameter. ```js assert.match(code, /const\s+evalFormula\s*=\s*\(\s*x\s*,\s*cells\s*\)\s*=>\s*{\s*const\s+idToText\s*=\s*(\(\s*id\s*\)|id)\s*=>/); ``` Your `idToText` function should return the result of calling the `.find()` method on your `cells` array. Your callback function should use an implicit return. ```js assert.notMatch(code, /const\s+evalFormula\s*=\s*\(\s*x\s*,\s*cells\s*\)\s*=>\s*{\s*const\s+idToText\s*=\s*(\(\s*id\s*\)|id)\s*=>\s*cells\.find\(\s*(\(\s*cell\s*\)|cell)\s*=>\s*\{/); ``` Your `idToText` function should use an implicit return. ```js assert.match(code, /const\s+evalFormula\s*=\s*\(\s*x\s*,\s*cells\s*\)\s*=>\s*{\s*const\s+idToText\s*=\s*(\(\s*id\s*\)|id)\s*=>\s*cells\.find\(/); ``` You should pass a callback function to your `.find()` method. Use arrow syntax. ```js assert.match(code, /const\s+evalFormula\s*=\s*\(\s*x\s*,\s*cells\s*\)\s*=>\s*{\s*const\s+idToText\s*=\s*(\(\s*id\s*\)|id)\s*=>\s*cells\.find\(\s*(\([^)]*\)|[^\s()]+)\s*=>/); ``` Your callback function should have a `cell` parameter. ```js assert.match(code, /const\s+evalFormula\s*=\s*\(\s*x\s*,\s*cells\s*\)\s*=>\s*{\s*const\s+idToText\s*=\s*(\(\s*id\s*\)|id)\s*=>\s*cells\.find\(\s*(\(\s*cell\s*\)|cell)\s*=>/); ``` Your callback function should return whether `cell.id` is strictly equal to `id`. ```js assert.match(code, /const\s+evalFormula\s*=\s*\(\s*x\s*,\s*cells\s*\)\s*=>\s*{\s*const\s+idToText\s*=\s*(\(\s*id\s*\)|id)\s*=>\s*cells\.find\(\s*(\(\s*cell\s*\)|cell)\s*=>\s*(?:cell\.id\s*===\s*id|id\s*===\s*cell\.id)/); ``` # --seed-- ## --seed-contents-- ```html