A list of tags, CSS class names or user names should only ever hold strings. One stray number pushed into it shows up much later as a crash in tag.toLowerCase(), far from the code that put it there. A Proxy lets the array itself refuse the bad value at the moment it is written, so the error points at the real culprit.
Write createStringArray(...items) in string-array.js. It returns a real array (wrapped in a Proxy) that accepts only strings as items. Any attempt to put a non-string at an index throws a TypeError, whichever way it is attempted.
The result holds the given strings in order. createStringArray() is an empty array. Array.isArray(result) is true.
A non-string initial item makes createStringArray throw a TypeError.
Writing a string to an index works as on any array, including past the end (length grows). The empty string is a string.
Writing any other value to an index (number, undefined, null, boolean, object, array, new String("x"), symbol, bigint, function) throws a TypeError, and that value is not stored: the index keeps what it held before.
The rule holds for every way of writing an item: list[i] = v, push, unshift, splice, fill, Object.assign and Object.defineProperty. A getter or setter defined at an index is rejected too, and so is a descriptor without a value (such as {}) that would create a new index. A descriptor without a value may change the flags of an existing item.
Each item is checked when it is written, one write at a time. A method that writes several items stops at the first refused one, and the writes it made before that stay: starting from ["a"], push("b", 3) throws and leaves ["a", "b"].
The error message names the index that was refused.
Only array indexes are guarded: property names that are whole numbers from 0 to 2 ** 32 − 2 written the canonical way ("0", "15", not "01", "-1" or "1.5"). length, named properties such as label, other strings and symbol keys accept any value, as on a normal array.
length can still be set: shorter removes items, longer adds holes.
Reading methods work and return ordinary arrays: list.map((s) => s.length) returns [1, 2], not an error. sort and reverse work.