1 - Into the following code snippet my array contains following items some of the items are duplicate and all are the arrays within array
arr[0] = ["Family Practice"]
arr[1] = ["Family Practice", "General Practice"]
arr[2] = ["Family Practice", "General Practice", "Geriatrics"]
arr[3] = ["Family Practice"]
How can I remove duplicate and return unique items in array .
2 - When adding the items into the array using push for ex.
function(items) {
arr.push(items)
}
Here every time items are getting changed the array items are also getting changed. How can I array make immutable without any modification in the array irrespective if items change or not.