I have an object in javascript that contains a mix of String values along with some functions in the object. I need to loop through this object and return an array of just the String values, not the functions.
I have created an array that is set to arrayObject = Object.values(javaObject) and using a for loop to loop through this - something like this:
let objectInput = [];
for (let i = 0; i < arrayObject.length; i++) {
if(arrayObject[i] === String){
objectInput.push(arrayObject[i]);
}
else {
continue;
}
} return(objectInput);
This just passes right by the IF statement and can't figure out how to look for just the String values and exclude the functions from the object - any pointers?