???? Day 04 of #100DaysOfTypeScript Challenge!
Mubashir Bashir
Web Developer | Wordpress Developer | Shopify | React JS | GenAI learning Journey
??Question_13: Your Own Array: Think of your favorite mode of transportation, such as a motorcycle or a car, and make a list that stores several examples. Use your list to print a series of statements about these items, such as “I would like to own a Honda motorcycle.”
var fav_transp = ["Tesla", "Bently", "Rolls-Roys", "Lexus Ls", "Kawasaki Ninja", "Suzuki Hayabusa"];
for (var i = 0; i < fav_transp.length; i++) {
console.log("I would like to own a ".concat(fav_transp[i]));
}
??Question_14: Guest List: If you could invite anyone, living or deceased, to dinner, who would you invite? Make a list that includes at least three people you’d like to invite to dinner. Then use your list to print a message to each person, inviting them to dinner.
let guest_list = ["Ali","Adnan","Kamran"]
for(let i=0; i<guest_list.length;i++){
console.log(`Hi ${guest_list[i]}, I'm inviting you to dine with me`)
}
??Question_15: Changing Guest List: You just heard that one of your guests can’t make the dinner, so you need to send out a new set of invitations. You’ll have to think of someone else to invite.
let guest_list = ["Ali","Adnan","Kamran"]
for(let i=0; i<guest_list.length;i++){
console.log(`Hi ${guest_list[i]}, I'm inviting you to dine with me`)
}
let cancelGuest = guest_list.indexOf("Adnan")
console.log(`\n Sorry guys ${guest_list[cancelGuest]} is not comming for dinner `)
guest_list.splice(cancelGuest,1,"Hammad")
console.log("\n Our new guests are :"
)
for(let i=0; i<guest_list.length;i++){
console.log(`Hi ${guest_list[i]}, I'm inviting you to dine with me`)
}