Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJason Peay
16,515 PointsHow to create an anonymous function and log a string?
In the "goodbye task", create an anonymous callback function as the second parameter. Inside the body of the function, log the string 'goodbye'.
I'm not sure if I'm forgetting a step or completing the task wrong. Would someone kindly assist me in trying to solve this code challenge.
thank you.
jason
var gulp = require('gulp');
gulp.task("goodbye", (function) {
console.log("goodbye!");
});
1 Answer
Alexander Davison
65,469 PointsYou are creating a anonymous function incorrectly, and also are logging the wrong message.
Steps you should follow to fix your program:
-
Change
(function) {
tofunction () {
. The parentheses are there at the end, so that if you want to supply parameters you can put it inside them - The code challenge is very specific, even if you have an extra exclamation point at the logged message. You should probably get rid of the extra exclamation point :)
I hope this helps. ~Alex