JSON.stringify as name suggests convert a JavaScript object into a string representation. Most likely to exchange date to/from a web server.
This function expects only one required parameter, that is the object you want to stringify. The reason you were getting the email value but not password was that javascript was ignoring the second parameter.
Having said that, you can either pass your values into an array object, in this format
JSON.stringify([email,password])
In this case your variables shall be stringified into an array of two string values, for example ["some@emailadress.com","somestring"]
Another approach can be to stringify an object, for example
JSON.stringify({email, password})
In this case your variables shall be stringified into a javascript object like this
{"email":"some@emailadress.com", "password":"somestring"}
You can also construct your own JSON object like this
JSON.stringify({emailaddress:email, passwordValue: password})
The benefit of constructing a JavaScript object is that on the server side you can receive parameters with names.
Thanks.