I have a problem like my title. Here is the data I want to convert:
I want to convert 1 to Active and 0 to Not Active.
This is my datatables script:
$(function () {
$('#userTable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": true,
"scrollX": true,
"ajax": {
"url" : "admin/auth/getUserData",
"dataSrc" : function(json) {
console.log(json);
return json.Users
}
},
"columns": [
{ "data": "Username"},
{ "data": "Email"},
{ "data": "Fullname"},
{ "data": "IdentityNumber"},
{ "data": "InstitutionName"},
{ "data": "UserStatus"},
});
});
In our logic, it must be
if("data":"UserStatus" == 1)
document.write("Active");
else
document.write("Not active");
I've tried the code above but it failed to get the output I want. Can anybody help me fix this? Thanks

if("data":"UserStatus" == 1)is not valid JavaScript.