The array contains Items made up of a string and some variables. If one of the variables is undefined I would like to filter the whole item out of the Array. Example below.
Full Array:
[ 'hello', 'hi undefined', 'good day' ]
Filtered Array:
[ 'hello', 'good day' ]
Array Code:
const testArray = [
'hello',
'hi ' + variableX, //variableX is undefined
'good day'];