Skip to content

3. Recipes

Jared Van Valkengoed edited this page Jul 8, 2024 · 5 revisions

Recipes

Get answers in an object

When asking many questions, you might not want to keep one variable per answer everywhere. In which case, you can put the answer inside an object.

const answers = {
  firstName: await term.input("What's your first name?"),
  allowEmail: await term.input('Do you allow us to send you email?'),
};

console.log(answers.firstName);
Clone this wiki locally