17 lines
197 B
JavaScript
17 lines
197 B
JavaScript
var getUser = (id, callback) => {
|
|
var user = {
|
|
id: id,
|
|
name: "tyrel"
|
|
}
|
|
|
|
setTimeout(() => {
|
|
callback(user)
|
|
|
|
}, 3000);
|
|
};
|
|
|
|
|
|
getUser(100, (user) => {
|
|
console.log(user);
|
|
})
|