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
0%
Quiz#7 - NodeJS
共享
共享
共享
由
Kdyahya
编辑内容
打印
嵌入
更多
作业
排行榜
显示更多
显示更少
此排行榜当前是私人享有。单击
,共享
使其公开。
资源所有者已禁用此排行榜。
此排行榜被禁用,因为您的选择与资源所有者不同。
还原选项
随堂测验
是一个开放式模板。它不会为排行榜生成分数。
需要登录
视觉风格
字体
需要订阅
选项
切换模板
显示所有
播放活动时将显示更多格式。
打开成绩
复制链接
QR 代码
删除
恢复自动保存:
?