I was trying to create an array in JSON format so that it stores name mailId and password of the user dynamically each time a new user signs up.I was able to create for one user but i am stuck in creating a loop and also to push the element in the array var user [];.can anyone suggest me how to do this ?
var user = [];
document.getElementById("sub").addEventListener("click",function store(){
var user = {};
user.name = document.getElementById("nme").value;
user.emailId = document.getElementById("mail").value;
user.password = document.getElementById("pd").value;
console.log("user", user);
});
var user = {}tovar _tmp = {}and at the enduser.push(_tmp)