function findingMultidimensionalArrays(arrList, value) {
if (Array.isArray(arrList)) {
let arr = []
arrList.forEach((item) => {
if (typeof item === 'object') {
if (Array.isArray(item)) {
const list = findingMultidimensionalArrays(item, value)
list.length > 0 && arr.push(...list)
} else {
const obj = isObjectArray(item, value)
if (obj) {
if (Array.isArray(obj)) {
arr.push(...obj)
} else {
arr.push(obj)
} else {
if (item === value) {
arr.push(item)
return arr
function isObjectArray(item, value) {
if (item) {
const keys = Object.keys(item)
let res = null
keys.forEach((val) => {
if (typeof item[val] === 'object') {
if (Array.isArray(item[val])) {
if (item[val].length > 0) {
const list = findingMultidimensionalArrays(item[val], value)
list && (res = list)
} else if (typeof item[val] === 'object') {
res = isObjectArray(item[val], value)
} else {
item[val] === value && (res = item)
return res
const arr = findingMultidimensionalArrays(list, "4811")
复制代码