I have an object:
let myObject = {first: "", second: null};
And I have a function:
return Object.values(myObject).some(
objectValue => objectValue !== "" && typeof objectValue !== "undefined" && typeof objectValue !== null
);
What this does is that it returns true
if an object has a set value and returns false
if an object doesn't have any set values. The thing is that when I pass a null
value, this function returns true
(as if the object has a set value).
On other occasions it works fine. What is wrong here?