Javascript for getting values from Different Doctype but getting an object instead

Hi,
I am trying to create a javascript js file in a doctype and I am unable to get the values from the different doctype. Here is the sample of the code:

frappe.ui.form.on('Custom Doctype Name', 'field_name_on_change_this_code_is_executed', function(frm){
    var check = frappe.db.get_value('Doctype_IN_ERPNext', 'nameofdocument', 'field_name')
    console.log(check)
});

Now the problem is that the value of the check is coming out to be an object instead of just a value.

Sorry for my limited knowledge in js scripting since I am expecting a result as per python scripting.

@adityaduggal Try this:

frappe.ui.form.on('Custom Doctype Name', 'field_name_on_change_this_code_is_executed', function(frm){
    frappe.db.get_value('Doctype_IN_ERPNext', 'nameofdocument', 'field_name')then((r) => {
			 console.log(r);
			 console.log(r.field_name);
		});        
});