
Hello I have problem return a value in function using ajax, And I am solved problem after search in google.com and recomend from stackoverflow. So, in my case only add async : false in function ajax.
function insert(data_nya){
let returnStatus = false;
$.ajax({
method: 'POST',
...