Intro to JavaScript: Function Exercise (icanhaz())

Hey guys, I’ve been trying to figure out this particular Function exercise. It’s the quiz that I have to take after completing the Function segment. It can be found here:

I’m at the part where it asked me to write the icanhaz() function. This is what I currently have. After few trial and errors, I still can’t get it right. I’d really appreciate it if anyone is able to assist me on this. Thank you very much.

Hi @snailmachine

I’m not great with JS, tbh, but… there’s one obvious thing where you’ve gone wrong, that I can see.

In your else block, you have this:

} else {
  return 'i can haz presentz?';

The exercise requirement states that if an argument is provided - i.e. icanhaz("french fries"); - the function should return “i can haz french fries”, so there should be a string returning i can has [argument], which you aren’t doing. :slight_smile:

Hey there @thepitycoder, thanks for providing me the tips! Assigned a parameter to the function and it works. Appreciate it mate!