📌  相关文章
📜  search_result={} fetch(` search ${name}`) .then(Response =>Response.json()) .then(Response => { this.search_result = Response.map( x=>{ let result ={} ; Object.assign(result,x); return result }) - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:06.197000             🧑  作者: Mango

代码示例1
const url = "https://api.github.com/users/RodrigoWebDev/repos?per_page=100&sort=created";
fetch(url)
  .then((response) => response.json())
  .then((data) => {
      return data.map(item => {
        //item.full_name returns the repositorie name
        fetch(`https://raw.githubusercontent.com/${item.full_name}/master/built-with.json`)
          .then(data => {
            item["filters"] = data
            return item
          })
      })
    })
  .then(data => console.log(data))