Tuesday, May 1, 2018

Unravel variables from a type as their own variables in TypeScript.

Here will will hand in a Baz and then pluck just the foo property and the baz property off of the Baz into two new variables called foo and bar respectively.

function updateAnswers({ foo, bar }: Baz): Array<Qux> {
   const fubar = foo + bar;

No comments:

Post a Comment