Try this with an execute code card let variable1 =...
# 🌎general
f
Try this with an execute code card let variable1 = ["house", "car", "apple", "pen"]; let variable2 = ["house", "pen"]; let variable3 = variable1.filter(item => !variable2.includes(item)); let resultString; if (variable3.length > 1) { resultString = variable3.slice(0, -1).join(', ') + ' and ' + variable3[variable3.length - 1]; } else if (variable3.length === 1) { resultString = variable3[0]; } else { resultString = ''; } console.log(resultString);