This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Features { | |
// made it static so it can be called from main | |
private static int addOne(int value) { | |
return ++value; | |
} | |
public static void main(String[] args) { | |
// ==================== Functional interfaces and lambdas ==================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require('node-fetch') | |
const fetchUserAvatar = async (userId) => { | |
const response = await fetch(`http://catappapi.herokuapp.com/users/${userId}`) | |
response // actual response, not the promise | |
const data = await response.json(); // without await, data will be a promise that resolves to the desired data | |
data | |
return data.imageUrl; |
NewerOlder