Can't get values from Backendless table on javascript

I have the table “Products” with full fields. I try to find and get values with some condition. This is javascript file

var APPLICATION_ID = "id",
SECRET_KEY = "key",
VERSION = "v1"; 
Backendless.initApp(APPLICATION_ID, SECRET_KEY, VERSION);


function Products(args) {
 


 args = args || {};
 


this.id_user = args.id_user || "";
 


 this.cal = args.cal || null;
 


 this.id_day = args.id_day || null;
 this.id_product = args.id_product || null;
 


 this.nameProduct = args.nameProduct || "";
}


var productStorage = Backendless.Persistence.of( Products );

var query = { 
 


 condition : "id_day = 33"
}

function get(){
 


 try{
 


 var product = productStorage.find(query);
 


 }catch( e )
 {
 


 if( e.code != 1009 )
 


 alert(e.message);
 


 }
 


 return product;
}



var array = get(); 
console.log(array);
alert(JSON.stringify(array));

i got “response: “… class”:“Products”,“id_day”:“33”,“ownerId”:null…” in XMLHttpRequest{} in console. It is what i need to get. So there is exist my information, but how to get it from responce?
But when i call alert(JSON.stringify(array)); . i get " {} ". So its empty…
if i write

alert(JSON.stringify(array.data.id_user));

i get just “undefined”.

Take a look at the following API documentation:https://backendless.com/documentation/data/js/data_basic_search.htm

Also see this for an example of retrieving data using JS:
https://backendless.com/feature-16-data-retrieval-api-how-to-load-objects-from-an-mbaas-storage/

Mark

Mark, thank you!! I dont know how, but it is works. Thank you for the example, i didnt see it.

Regards
Kira