Validate Javascript data and types