Rod*_*ias 4 javascript arrays jquery
我需要检查主数组中是否存在特定值.
var hideFilters = function() {
var listCategoryId = ['1000014', '1000015', '1000016', '1000017', '1000018', '1000019', '1000021', '1000086'];
var actualCategoryId = '1000018';
if (actualCategoryId === listCategoryId) {
console.log('is equal');
} else {
console.log('fuen... fuen...');
}
};
hideFilters();
Run Code Online (Sandbox Code Playgroud)
if(listCategoryId.indexOf(actualCategoryId) != -1) {
console.log('exists')
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
194 次 |
| 最近记录: |