You can create an array of fruit names and then use a for loop to iterate over the array and do something with each element. Here's an example:
index.tsx169 chars7 lines
This will loop over the fruits
array and log each fruit name to the console. You can replace the console.log
statement with any other code you want to execute for each fruit.
gistlibby LogSnag