I have an array given below, every element of this array consists of another array.
var array = [
['201', 'Tom', 'EES', 'California'],
['189', 'Charlie', 'EE', 'New Jersey'],
['245', 'Lisa', 'EEF', 'New Jersey'],
['743', 'Niall', 'EEC', 'Chicago'],
['653', 'Tim', 'EES', 'Miami'],
['333', 'Dev', 'EE', 'Washington'],
['333', 'Rhonda', 'EEC', 'Washington']
]
I want it to be sorted on the basis of 3rd value and in this order [EE,EES,EEC,EEF]
.
array should be:
[
['189', 'Charlie', 'EE', 'New Jersey'],
['333', 'Dev', 'EE', 'Washington'],
['201', 'Tom', 'EES', 'California'],
['653', 'Tim', 'EES', 'Miami'],
['743', 'Niall', 'EEC', 'Chicago'],
['333', 'Rhonda', 'EEC', 'Washington'],
['245', 'Lisa', 'EEF', 'New Jersey']
]
Note :- Original array will be having n no of elements, all i want is that first EE elements should come , then EES, EEC and then EEF
Thanks in advance.