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

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e52b68-43f0c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e52b68-43f0c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?