<script>
$(document).ready(function() {
const fetchData = () => {
const promise = new Promise((resolve, reject) => {
setTimeout(() => {
resolve("Loose Cannon Fitness");
}, 100);
});
return promise;
};
setTimeout( async () => {
console.log("Smith and Gone");
var text = await fetchData();
console.log(text);
}, 200);
});
</script>
$(document).ready(function() {
x = function(cb) {
setTimeout(function() {
console.log("Smith and Gone");
cb();
}, 200);
}
y = function() {
console.log("Loose Cannon Fitness");
}
x(y);
});
$(document).ready(function() {
x = (cb) => {
setTimeout(function() {
console.log("Smith and Gone");
cb();
}, 200);
}
let y = () => {
console.log("Loose Cannon Fitness");
}
x(y);
});
const fetchData = () => {
const promise = new Promise((resolve, reject) => {
setTimeout(() => {
resolve("Loose Cannon Fitness");
}, 100);
});
return promise;
};
setTimeout(() => {
console.log("Smith and Gone");
fetchData()
.then(text => {
console.log(text);
});
}, 200);
$(document).ready(function() {
const fetchData = () => {
const promise = new Promise((resolve, reject) => {
setTimeout(() => {
resolve("Loose Cannon Fitness");
}, 100);
});
return promise;
};
setTimeout( async () => {
console.log("Smith and Gone");
var text = await fetchData();
console.log(text);
}, 200);
});
$(document).ready(function() {
const fetchData = () => {
setTimeout(function() {
console.log("Loose Cannon Fitness");
}, 200);
}
setTimeout( async () => {
console.log("Smith and Gone");
var text = await fetchData();
console.log(text);
}, 200);
});
const fetchData = () => {
setTimeout(function() {
//console.log("Loose Cannon Fitness");
//var text = "Loose Cannon Fitness";
//return text;
return "Loose Cannon Fitness";
}, 200);
}
const fetchData = () => {
var text="";
setTimeout(function() {
//console.log("Loose Cannon Fitness");
var text = "Loose Cannon Fitness";
}, 200);
return text;
}
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE