Functions as Parameters

Hi guys,
I’m stuck on line 8 of my code (“checkA === checkB”). It should return the result of the callback function if true. I´ve tried to put “func(val)” or “checkA” or “checkB()” but in vain. Where is the problem? Thank you in advance! :slight_smile:
https://www.codecademy.com/courses/introduction-to-javascript/lessons/higher-order-functions/exercises/functions-as-parameters

type or paste code here

const addTwo = num => {
  return num + 2;
}

const checkConsistentOutput = (func, val) => {
let checkA = val + 2;
let checkB = func(val);
checkA === checkB ? func(val) : 'inconsistent results';
}

console.log();

You forgot to return ‘func(val)’ or ‘inconsistent results’ from your function checkConsistentOutput. If you add the return keyword and add the right arguments to your console.log(), you’ll get the right result.

Exactly this lesson really don´t wants into my brain. Thx Marcoman, that I am not the only one who gets stuck here :wink:

Thanks a million! It still took some work but I got it finally. Great hint! :+1:

1 Like

Yeah, you are welcome :slight_smile: