1) What is Moment.js used for? a) File handling b) Date and time manipulation c) Array sorting d) Data encryption 2) How do you include Moment.js in a Node.js project? a) require('moment') b) import moment from 'date-module' c) const moment = require('time-manager') d) include('moment.js') 3) Which method gets the current date and time using Moment.js? a) moment.date() b) moment.get() c) moment() d) moment.now() 4) What is the correct way to format the date as YYYY-MM-DD in Moment.js? a) moment().format('YYYY-MM-DD') b) moment().formatDate('YYYY-MM-DD') c) moment().toDate('YYYY-MM-DD') d) moment().toString('YYYY-MM-DD') 5) How do you add 7 days to the current date in Moment.js? a) moment().addDays(7) b) moment().plus(7, 'days') c) moment().add(7, 'days') d) moment().add(7) 6) What does moment().subtract(1, 'month') do? a) Subtracts 1 day from the current date b) Subtracts 1 hour from the current date c) Subtracts 1 month from the current date d) Subtracts 1 year from the current date 7) How can you get the day of the week for a specific date in Moment.js? a) moment().day() b) moment('2025-01-01').format('dddd') c) moment().getDay() d) moment().weekDay() 8) Which method is used to check the difference between two dates in days? a) moment().diffInDays(otherDate) b) moment().difference(otherDate, 'days') c) moment().diff(otherDate, 'days') d) moment().daysBetween(otherDate) 9) How do you parse a date in DD/MM/YYYY format using Moment.js? a) moment('25/12/2025').toDate('DD/MM/YYYY') b) moment('25/12/2025', 'DD/MM/YYYY') c) moment('25-12-2025', 'DD-MM-YYYY') d) moment().parse('25/12/2025', 'DD/MM/YYYY') 10) How do you get the current year using Moment.js? a) moment().get('year') b) moment().year() c) moment().getYear() d) Both A and B

Tulostaulu

Visuaalinen tyyli

Vaihtoehdot

Vaihda mallia

Säilytetäänkö automaattisesti tallennettu tehtävä ?