26. Passing Arguments


#1


I'm curious what is the point of this lesson? You can't use this to authenticate the user, cause anyone can see your js code. Is it just to illustrate or is there any practical application to it?



#2

actually, with frameworks like firebase you can authenticate a user on client-side. But directly in javascript, i wouldn't do this.

I think it is just for illustration. But what you can do is client side validation (is the username not blank? Is the password the minimum 6 characters?) Yes, beside this you still need to do server side validation, but if you also do client side validation will save you a lot of requests to your server (the average user of a side has no idea what javascript is), does that make sense?