Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const cung = [
- "Ma Kết", // 0
- "Bảo Bình",
- "Song Ngư",
- "Bạch Dương",
- "Kim Ngưu",
- "Song Tử",
- "Cự Giải",
- "Sư Tử",
- "Xử Nữ",
- "Thiên Bình",
- "Bọ Cạp",
- "Nhân Mã",
- ];
- const data = [
- 20, 19, 21,
- 21, 21, 22,
- 23, 23, 23,
- 24, 23, 22,
- ];
- const getCung = (day, month) => {
- let i = month - 1;
- if (day >= data[i]) {
- ++i;
- }
- i = i % cung.length;
- console.log(cung[i])
- }
- getCung(21,3);
- getCung(20,3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement