Write a function that returns the items from an array (given as parameter r) on odd or even positions, depending on it's specifier (given as parameters) as being the parity. The final array will contain "odd" items on odd positions (1, 3, 5, ...) and "even" for items on even positions (2, 4, 6, ...).
charAtPos([2, 4, 6, 8, 10], "even") ➞ [4, 8]
// 4 & 8 occupy the 4th & 2nd positions from right.
charAtPos(['E', 'D', 'A', 'B', 'I', 'T'], "odd") ➞ ['D', 'B', 'T']
// D, B and T occupy the 5th, 3rd and 1st positions from right.
charAtPos([")", "(", "*", "&", "^", "%", "$", "#", "@", "!"], "odd") ➞ ["(", "&", "%", "#", "!"]8 should come after 4 and not otherwise, example #2 - 'B' should come after 'D' and before 'T').