Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
still broken
Approved
Fixed
Exercise test cases are now fixed.
description updated, please check if it's clearer.
thanks!
Please validate emails properly. If you don't use the "+" sign in your email, it doesn't mean that nobody does. Over the world, probably millions do.
So now that we have established the need to properly validate - the official and authoritative specifications for valid emails is pretty complicated, actually.
That's where the idea of server-side validation comes from, to avoid loading big libraries on the client for a simple and one time only task such as validation. The email will be transmitted to the server anyway - there is no use of validating an email address if it's not for sending it to a server. So might as well do the important part of the validation on the server.
You could implement it client side and it has it's advantages. Depending on the case and needs, either approach can be favorable.
done.. thanks!
This is your mistake. You don't validate emails using a regex. It's extremely inefficient, and incredibly huge.
For details on the complete, fully-valid regex, read more here.
The important thing to realize: you can 100% fully validate that the text entered is a valid email, and you still won't have solved anything useful. A valid email address doesn't prevent typos (
gmial.com
), and doesn't guarantee that the email address is a legitimate one (dont-send-me-spam@kjdflkjdsfsdklf.net
).The only way you can safely check an email address is to send it an email and check to see if you get a bounce. This is literally the only meaningful way to validate an email. If you aren't planning on sending a validation email, you might as well just accept
/.+@.+/
.Thank you for the help. I have now changed the description to be less confusing.
Because whatever code is sending the function the points already has the points. It just needs the new average. Presumably then it would story the new points and the new average itself.
Yeah... I think it's pretty obvious that it needs to be returned myself (how would the result be teste otherwise?), but I've added a note that the new value should be returned. Thanks for your comment.