export const getElement = (selection) => {
const element = document.querySelector(selection);
if (element) {
return element;
}
throw new Error(
`Please check "${selection}" selector, no such element exists`
);
}
export const getAllElements = (elements) => {
const allelements = document.querySelectorAll(elements);
if(allelements){
return allelements
}
throw new Error(`These ${elements} cannot be found`)
}