关于Fetch的then

版权声明:竹子原创,未经允许不得转载 https://blog.csdn.net/u010411264/article/details/80339124

fetch('http://example.com/movies.json')
  .then(function(response) {
    return response.json();
  })
  .then(function(myJson) {
    console.log(myJson);
  });
我一直以为.then只是一个返回的结果,却不知道后面的.then是前面的then的封装结果

fetch()

.then(function(vaule1) {return "hello" })

.then(function(vaule2) { return "hello world" })

.then(function(vaule3){}

比如 vaule1 是直接返回的结果

vaule2 = "hello"

vaule3 = "hello world"


猜你喜欢

转载自blog.csdn.net/u010411264/article/details/80339124