I'm new to javascript and promises. I'm trying to get one function not to start running until the first function has completed.
In this case, I want the "dontDoUntilDelayIsComplete" function to run AFTER the "delayGreet" function.
function delayGreet() {
    setTimeout(greet, 1000);
}
function greet() {
    para1.textContent = "Hi there!";
}
function createPromise() {
    return new Promise((resolve) => resolve(delayGreet));
}
function dontDoUntilDelayIsComplete() {
    para2.textContent = "Please dont do before";
}
function callMethod() {
    createPromise().then(dontDoUntilDelayIsComplete);
}
callMethod();`
I've tried putting the functions within a promise and use the .then() method. However, I'm unable to get it to work.
 
     
    