I try to create a function that gives me a true or false.
function libs(selector){
let elementAll;
if(typeof selector !== 'object'){
elementAll = document.querySelectorAll(selector);
}
return{
windowScroll: (props) => {
window.onscroll = function (e) {
//return true
}
}
}
}
I call the function in my footer
if(libs().windowScroll()){
//if is true do something
};
The code above do not give me the boolean
Who can help me with this?