SEARCH
You are in browse mode. You must login to use MEMORY

   Log in to start


From course:

TypeScript

» Start this Course
(Practice similar questions for free)
Question:

How would you change the code below to make chargeVoltage an optional property? function printCar(car: { make: string model: string year: number chargeVoltage: number })

Author: John Pencola



Answer:

Add the optional operator (?) ie: chargeVoltage?: number


0 / 5  (0 ratings)

1 answer(s) in total