var products=[1,2,3];
product_edits();//GIVES [1,2,3].
myApp.onPageInit("mypage",function(page){
console.log(products);//undefined
var products=[3,2,1];
product_edits();//GIVES [1,2,3]?? Shouldn't this be 3,2,1?
});
function product_edits(){
$(element).click(function(){
console.log(products);
});
}
I'm certain pageInit was called. but i don't know why products still gives 1,2,3 when i thought the values should have changed to 3,2,1.