What does [object Object] mean?

后端 未结 10 2020
醉酒成梦
醉酒成梦 2020-11-22 03:22

I am trying to alert a returned value from a function and I get this in the alert:

[object Object]  

Here is the JavaScript code:



        
10条回答
  •  长情又很酷
    2020-11-22 04:27

    You can see value inside [object Object] like this

    Alert.alert(  JSON.stringify(userDate)  );
    

    Try like this

        realm.write(() => {
           const userFormData = realm.create('User',{
           user_email: value.username,
           user_password: value.password,
          });
         });
    
          const userDate = realm.objects('User').filtered('user_email == $0', value.username.toString(), );
          Alert.alert(  JSON.stringify(userDate)  );
    

    reference

    https://off.tokyo/blog/react-native-object-object/

提交回复
热议问题