Objective: Create an array containing various elements, including empty values, and return a new array with only the non-empty entries.
Instructions:
Define the Array:
Create an array variable named
mixed_arrayand assign it the values[0, "apple", "", [], "orange", null, 23, [], "banana", 0, ""].
Filter Non-Empty Entries:
Create a second array variable named
filtered_arrayand use a filter to create an array that contains only the non-empty entries frommixed_array.
Submit the array contained in the variable
filtered_array.
Expected Result:
Submit the variable filtered_array as your answer. See example below:
Install the snippet to get started: https://www.xano.com/snippet/XwN5GThx