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 代碼
刪除
恢復自動保存:
?