exam questions

Exam 98-382 All Questions

View all questions & answers for the 98-382 exam

Exam 98-382 topic 1 question 17 discussion

Actual exam question from Microsoft's 98-382
Question #: 17
Topic #: 1
[All 98-382 Questions]

HOTSPOT -
You are creating a JavaScript function that returns a date the specified number of months in the future of the current date.
The function must meet the following requirements:
Accept a number that represents the number of months to add or subtract from the current date.
Return the current data adjusted by the number of months passed into the function.
How should you complete the code? To answer, select the appropriate code segments in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
References:
https://www.w3schools.com/js/js_dates.asp
https://www.w3schools.com/js/js_date_methods.asp
https://www.w3schools.com/jsref/jsref_setmonth.asp

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Sathya235
3 years, 5 months ago
var date = new Date(); var month = date.getMonth(); date.setMonth(month+value)
upvoted 2 times
...
kisskeo
3 years, 7 months ago
Answer - Correct
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...