ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 6 - Certified JavaScript Developer I discussion

Report
Export

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);
Answers
A.
deliveryDate.setDate(( new Date ( )).getDate () +9);
B.
deliveryDate.setDate( Date.current () + 9);
Answers
B.
deliveryDate.setDate( Date.current () + 9);
C.
deliveryDate.date = new Date(+9) ;
Answers
C.
deliveryDate.date = new Date(+9) ;
D.
deliveryDate.date = Date.current () + 9;
Answers
D.
deliveryDate.date = Date.current () + 9;
Suggested answer: A
asked 23/09/2024
Maria Lilian Tongson
41 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first