My function has a parameter dtoIn and I am trying to check if it's undefined or null.
I have values assigned like this so it shouldn't be undefined, but I get that the object is undefined anyway. Can I have some advise please.
{
count : 10,
minAge : 10,
maxAge : 10,
}
function main(dtoIn={count, minAge, maxAge}) {
if (typeof dtoIn !== "undefined" && dtoIn !== null){
alert(`empty`);
}
}
count,minAgeandmaxAgesomewhere in the global scope. Also by defining a default value (if you do it correctly)dtoInwill never be undefined or null.function main(dtoIn={count:10, minAge:10, maxAge:10}) {...