Since: DataTables 1.10.15

Create an independent copy of the API instance.


The DataTables API object is "array like" and inherits many of the same characteristics as a Javascript array. The slice() method is one of these. It provides the ability to create an independent copy of the instance so it can be manipulated without affecting the original.

This method is a proxy for the Javascript Array.prototype.slice method and is provided as a utility method for the DataTables API. For more information about the original method, please refer to the Mozilla MDN documentation for slice.


function slice()


Create an independent copy of the API instance.


API instance


Modify a copy of an instance without affecting the original.:

var table = $('#example').DataTable();

var data = table
	.column( 0 )

var data2 = data.slice();

data2.push( 'Fini' );

// `data` is unaffected