This is not working any clue?
function hideColumns(hiddenCol){
// hide columns in table
console.log('hidding: ' + hiddenCol);
$('#example').dataTable( {
"columnDefs": [
{ "visible": false, "targets":hiddenCol }
]
} );
}