Promises and async/await

Async code is just code that doesn't complete immediately — network calls, file reads, timers. Promises give you a way to say "when this finishes, do this next."

async/await is syntactic sugar on top of Promises — it lets you write async code that reads like synchronous code.

You're given a chain of string transformations, each simulated as a Promise that resolves immediately. Apply them in order using async/await:

Operations (comma-separated):

  • upper — uppercase the string
  • reverse — reverse the string
  • trim — trim whitespace
  • exclaim — append !

Your program receives: <starting_string> <op1,op2,...>

Input:  hello upper,exclaim
Output: HELLO!

Constraints

  • Each operation must be applied via a Promise (wrap each in Promise.resolve() or an async function).
  • Use async/await — no raw .then() chains.
Ad SpaceGoogle AdSense active for guests & free-tier learners.