标签:tar sar dex fun 元素 target lse 包含 includes
let arr1 = [1, 2, 3]; arr1.includes(2) true arr1.indexOf(2)>0 true util.oneOf = function (ele, targetArr) { if (targetArr.indexOf(ele) >= 0) { return true; } else { return false; } }; util.showThisRoute = function (itAccess, currentAccess) { if (typeof itAccess === ‘object‘ && Array.isArray(itAccess)) { return util.oneOf(currentAccess, itAccess); } else { return itAccess === currentAccess; } };
标签:tar sar dex fun 元素 target lse 包含 includes
原文地址:https://www.cnblogs.com/v5captain/p/14116959.html