0

In python you can do:

goat, cabbage, wolf, farmer = puzzle.passengers

where array is a list of some type.

Is there a quick way to do the samething in typescript?

I tried:

var goat: Passenger, cabbage: Passenger, wolf: Passenger, farmer: Passenger = puzzle.passengers

but I get the following error

Type Passenger[] is not assignable to type Passenger

Property type is missing in type Passenger[]

in reference to the declaration of the farmer variable

Foobar
  • 7,458
  • 16
  • 81
  • 161

0 Answers0