A bug inside of implemented convertation string to Array?

Implemented methods have code like this:
const searchGenre = Array.isArray(genre) ? genre : Array(genre)
if input a string: “Mystery, Thriller” it will return Array of ONE element [‘Mystery, Thriller’] instead of array of TWO elements.

As a solution:
static stringToArray(str) {
return str.split(/;|.|,/g).map(c => c.trim());
}
const searchGenre = Array.isArray(genre) ? genre : this.stringToArray(genre)

BTW [moviesDAO.js] - countries are recieved as an array, while for genres we have a string(?)

Is it really bug?
I stuck with it.

Hi Vitaly_13280,

Thanks for the note - you found a bug!! The Array() function behaves differently than I thought.

We are writing a fix, and will notify you when it’s in production. :smiley: Can’t thank you enough for raising this issue.

Matt

Hi Vitaly_13280,

The fix for this issue is currently in production, for all future offerings of M220JS.

Thanks again for flagging.

Matt