Hi i am new to jquery/javascript. I have created a global variable. I set the value of value of this variable inside function like this:
var arr;
CreatecheckPassword: function() {
var pas = document.getElementById("pos-password")
var user = new db.web.Model("res.users").get_func("read")(this.session.uid, ['password']).pipe(function(result) {
arr = result.password;
alert(arr);//prints the expected value
});
alert(arr);//prints nothing
},
I don't know where i am doing wrong. I tried hard but was unable to find the solution. Can someone help.

arrvariable is set.