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 trial

JavaScript Gulp Basics Welcome to Gulp.js Create your first gulp task

How 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

gulpfile.js
var gulp = require('gulp');

gulp.task("goodbye", (function) {
    console.log("goodbye!");
});

1 Answer

You are creating a anonymous function incorrectly, and also are logging the wrong message.

Steps you should follow to fix your program:

  1. Change (function) { to function () {. The parentheses are there at the end, so that if you want to supply parameters you can put it inside them :smile:
  2. 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

:dizzy: