Exam4Training

Which code meets this new requirement?

A developer is working on an ecommerce website where the delivery date is dynamically calculated based on the current day. The code line below is responsible for this calculation. Const deliveryDate = new Date ();

Due to changes in the business requirements, the delivery date must now be today’s date + 9 days.

Which code meets this new requirement?
A . deliveryDate.setDate(( new Date ()).getDate () +9);
B . deliveryDate.setDate( Date.current () + 9);
C . deliveryDate.date = new Date(+9) ;
D . deliveryDate.date = Date.current () + 9;

Answer: A

Exit mobile version