js遞歸遍歷key

需求:根據Json對象,查找到某key所有值 var obj = { first: "1", second: { name: "abc", mykey: "2", third: { age: "30", mykey: "3" } }, forth: "4", mykey: "5" }; console.log(getMykey(obj, [])); function getMykey(obj,
相關文章
相關標籤/搜索