Write a typed function greet(name, title?) that returns a greeting string.
name is a required string.title is an optional string."Hello, {title} {name}!"; otherwise return "Hello, {name}!".
Signature: greet(name: string, title?: string) => string
The goal is to practice typing parameters and marking one optional with ?.
Mark the optional parameter with a ?: title?: string.
Inside, check whether title was passed before using it.
A template literal makes the string easy: ` Hello, ${name}! `.
Test natijalarini ko'rish uchun kodingizni ishga tushiring.