Advertisement
yarin0600

Untitled

Dec 25th, 2023
1,185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. interface IFaqItem extends Document {
  2.   question: string;
  3.   answer: string;
  4. }
  5.  
  6. const faq =  [
  7.         {
  8.             questione:"Is it possible to obtain the source code for each video?",
  9.             answer:"One of our initial rules for lecturers is that they are obligated to share the source code for any video that involves coding."
  10.         },
  11.         {
  12.             question:"How long is the access period for the course I purchased?",
  13.             answer:"The duration of access is determined by each lecturer upon purchase, with a minimum period of 3 months."
  14.         },
  15.         {
  16.             question:"Is it possible to download the videos from a course I have purchased?",
  17.             answer:"Downloading videos is not permitted as it is in compliance with our commitment to preserving the copyrights of our lecturers."
  18.         },
  19.         {
  20.             question:"What happens if I encounter technical issues while accessing the course content?",
  21.             answer:"In the event of technical issues, please contact our support team at [support email/phone number]. We are committed to resolving any technical difficulties you may encounter during your course access."
  22.         }
  23.     ]
  24.  
  25.  
  26. // const faqItems = faq.map((item: any) => ({ -> gives undefined
  27. //     question: item.question,
  28. //     answer: item.answer,
  29. // }));
  30.  
  31. const faqItems = Promise.all(
  32.     faq.map(async (item: any) => {
  33.     return { question: item.question, answer: item.answer };
  34.     })
  35. );
  36. faqItems.then((res) => console.log(res)).catch((error) => console.log("error: ", error))
  37. // console.log(faqItems);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement