Microsoft
98-382 · Question #2
98-382 Question #2: Real Exam Question with Answer & Explanation
Sign in or unlock 98-382 to reveal the answer and full explanation for question #2. The question stem and answer options stay visible for context.
Question
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.
function adjustMonth(value) {
// Dropdown 1 options:
// - var date = new Date();
// - var date = Date();
// - var date = new Date;
// - var date = Date;
// Dropdown 2 options:
// - var month = date.getMonth();
// - var_month = getMonth();
// - var month = date.getMonth();
// - var month = getMonth;
// Dropdown 3 options:
// - date.setMonth(month + value);
// - setMonth(month + value);
return date;
}
Unlock 98-382 to see the answer
You've previewed enough free 98-382 questions. Unlock 98-382 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.