如果数组A的值在数组B值中[复制]

时间:2022-03-04 22:52:57

This question already has an answer here:

这个问题已经有了答案:

If array A contains all weekdays in Array B, then I want to return True.

如果数组A包含数组B中的所有工作日,那么我想返回True。

var A = ["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY"]; var B = ["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"];

var =[“星期一”,“周二”,“日”,“星期四”,“星期五”);var B =[“星期一”,“周二”,“日”,“星期四”、“星期五”,“星期六”、“星期天”);

1 个解决方案

#1


0  

You can do like

你可以像

B.every(e => A.some(f => e == f))

#1


0  

You can do like

你可以像

B.every(e => A.some(f => e == f))