/*
A promise is a building object of JavaScript, using it we can easily do
asynchronous tasks. Also, the concept that is used to create clean code
basically promises.
*/
//Promise
let firstPromise = new Promise((resolved, reject) => {
let fullName = 'Muhammad Shahnewaz';
setTimeout(() => resolved(fullName), 3000); //we need to use setTimeout()
}).then((name) => {
console.log('I am ' + name); //Muhammad Shahnewaz
});