Js cycle problem

write a piece of data, I want to write it in a circular format
set= {[

        { src: "https://img.codeshelper.com/upload/img/2022/01/14/0lqjxr3yx2e2593.jpg"},
        { src: "https://dd-block.oss-cn-hangzhou.aliyuncs.com/MaeGQeZrfi.jpg"}
 ]}
 

in a paragraph like this, I want to write the src in the array in a circular format. How to write it is to loop out {src: "xxx"}

.
Jan.14,2022

I don't quite understand what you mean. Do you loop out multiple src strings by splicing?

add splicing logic to the for loop, and then reassemble or replace the original array


you don't understand this format. It should be
set= [{src: "https://dd-block.oss-cnhangzhou.aliyuncs.com/p3TxCFMa.jpg"},{ src:" https://dd-block.oss-cn-hangzhou.aliyuncs.com/MaeGQeZrfi.jpg"}] "?
do you want to extract the src inside and turn it into an array?
src= ["https://dd-block.oss-cnhangzhou.aliyuncs.com/p3TxCFMa.jpg","https://dd-block.oss-cn-hangzhou.aliyuncs.com/MaeGQeZrfi.jpg"]

"

just traverse it

const newSet = set.map(i => i.src)

clipboard.png


write out your original data and the data you want

Menu