I've noticed there are 2 ways for an input element validation:
element.checkValidity().element.validity.valid.
I understand that validity is an object while checkValidity is a function but I don't understand when should I use either one of them and what is the key difference between them.