Document.querySelector Null Check

var selection = document.querySelector('.selector') !== null;
Borma