function getStringCount(obj) {
let countString = 0;
function foo(object) {
for (let i in object) {
if (typeof object[i] === "object") {
foo(object[i]);
} else {
if (typeof object[i] === "string") {
countString++;
}
}
}
}
foo(obj)
return countString;
}
console.log(getStringCount([1, 2, 3, "1", ["1", 1, ["f", 1]]]))