首页 > 解决方案 > 如何在 Javascript 中将数据变量带出 .then() 方法

问题描述

一切正常,但是如何将变量“数据”从 .then() 方法中取出,以便稍后在程序中调用它?

fetch("http://localhost:8088/get/value")
.then(response => response.json())
.then(data => console.log(data));

标签: javascriptvariablesmethods

解决方案


推荐阅读