isNull function checks if element is null or undefined