This solution is generated by ChatGPT, correctness is not guaranteed. You might also be able to find a solution fromcommunity posts.
AI solution for JavaScript Quiz on BFE.dev
78. RegExp
The code outputs an array of strings containing only lowercase letters from the original array arr
. In this case, it would log ['a', 'b', 'c']
. The regular expression /^[a-z]$/gi
matches any string that starts with a lowercase letter from a-z and ends with the same. The filter()
method filters out any element in the original arr
that doesn't match the regular expression.