const isPalindrome = (str) => {
const preprocessing_regex = /[^a-zA-Z0-9]/g,
processed_string = str.toLowerCase().replace(preprocessing_regex , ""),
integrity_check = processed_string.split("").reverse().join("");
if(processed_string === integrity_check) return true
else return false
}
//if you find this answer is useful ,
//upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)