To me, it just magically insert the variable into the string for suggestion. I wonder what kind of the syntax is this, any reference? Thanks.

1 Answer 1


This is the template syntax used by the Underscore.js JavaScript library.

There's a link to the full documentation in the Problem Specification.

You may also wish to pay special attention to this section of the Problem Specification.

I will note, however, that setting up and configuring the underscore.js template is not the main focus of this exercise. That work is already done for you by David Malan and the CS50 Staff in the distribution code provided.

No deep understanding of the implementation is required; all that is necessary to complete the Problem Set is that you understand that the template method is being called, and provide a correctly-formatted template for it to use.

In that sense, it may as well be magic!

Hope this helps.

  • 1
    crystal clear!! thank you!
    – Wayne Lin
    Sep 18, 2016 at 16:05
  • You're welcome! Sep 18, 2016 at 23:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .