A note that may be missing

A missing note and an empty note are different inputs.

your task

Keep note optional. Return “No note” when it is missing. For a present note, trim its text and keep the “Note: ” prefix, including its space. The type check and all cases must pass.

A booking can omit its note. The starter stops when it tries to trim that missing value. A booking with an empty string still has a note.

Starter code
or press Ctrl EnterNot run yet

type check

Not run yetnotes.ts

Expected result: no type errors.

cases

Not run yetA note with surrounding spaces

Expected output

1Note: Late arrival
See the input and the code for this case
console.log(noteLine({ room: "Atlas", note: "  Late arrival " }));
Not run yetA missing note

Expected output

1No note
See the input and the code for this case
console.log(noteLine({ room: "Birch" }));
Not run yetAn empty note

Expected output

1Note:
See the input and the code for this case
console.log(noteLine({ room: "Cedar", note: "" }));