Validation for JavaScript objects.