I have the following array
var arr = ['1234','23C','456','356778', '56']
I want to remove array elements which are less than 3 characters and greater than 4 characters. The final result should be as follows
arr = ['1234', '23C', '456']; //only 3 and 4 digits in the array.
Secondly, I want to do the following. if 'arr' has elements longer than 3 characters, I need to clip of by removing the last digit. The final 'data' array should look like this.
arr = ['123', '23C', '456'];