1fetch('http://api.steampowered.com/ISteamUserStats/GetGlobalAchievementPercentagesForApp/v0002/?gameid=221380')
2 .then(function(response) {
3 return response.json();
4 })
5 .then(function(myJson) {
6 console.log(JSON.stringify(myJson));
7 });
8
1 function getvals(){
2 return fetch('https://jsonplaceholder.typicode.com/posts',
3 {
4 method: "GET",
5 headers: {
6 'Accept': 'application/json',
7 'Content-Type': 'application/json',
8 },
9 })
10 .then((response) => response.json())
11 .then((responseData) => {
12 console.log(responseData);
13 return responseData;
14 })
15 .catch(error => console.warn(error));
16 }
17
18 getvals().then(response => console.log(response));