I need to move four items from an array of items to the first four positions.
Let say I have the below array:
var countryList=['Afghanistan','Albania', 'Argentina', 'Australia', 'Bangladesh', 'Belgium','Brazil',...]
I need to move Argentina, Australia, Belgium, and Brazil at first four positions. The modified array should look like:
var modifiedCountryList=['Argentina', 'Australia','Belgium', 'Brazil', 'Afghanistan', 'Albania', 'Bangladesh', ...]
I have found an answer here but it is for a single array element position move.
It seems like simple but I can not wrap my head around it.