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
แก้ไขเนื้อหา
สั่งพิมพ์
ฝัง
เพิ่มเติม
กำหนด
ลีดเดอร์บอร์ด
แสดงเพิ่มขึ้น
แสดงน้อยลง
ลีดเดอร์บอร์ดนี้ตอนนี้เป็นส่วนตัว คลิก
แชร์
เพื่อทำให้เป็นสาธารณะ
ลีดเดอร์บอร์ดนี้ถูกปิดใช้งานโดยเจ้าของทรัพยากร
ลีดเดอร์บอร์ดนี้ถูกปิดใช้งานเนื่องจากตัวเลือกของคุณแตกต่างสำหรับเจ้าของทรัพยากร
แปลงกลับตัวเลือก
แบบทดสอบ
เป็นแม่แบบแบบเปิดที่ไม่ได้สร้างคะแนนสำหรับลีดเดอร์บอร์ด
ต้องลงชื่อเข้าใช้
สไตล์ภาพ
แบบ อักษร
ต้องสมัครสมาชิก
ตัวเลือก
สลับแม่แบบ
แสดงทั้งหมด
รูปแบบเพิ่มเติมจะปรากฏเมื่อคุณเล่นกิจกรรม
เปิดผลลัพธ์
คัดลอกลิงค์
คิวอาร์โค้ด
ลบ
คืนค่าการบันทึกอัตโนมัติ:
ใช่ไหม