Javascript – How can I extend an array to fit same length of another array based on custom logic?
I have two different arrays: const texts = ['text1', 'text2', 'text3', 'text4'] const images = ['image1', 'image2'] I map over the text and display img corresponding but I always have fewer images. So I want to transform my images array…