Skip to content
DevTrail

Learn to code by doing it, right in your browser.

Every topic is worked out step by step: read it, watch the code run, predict the output, write the code, then practise the interview answer. Your code is checked on the page. For backend courses, take a task to your own editor and push it to GitHub.

courses
14
topics
978
exercises
3,203
learners
7
active this month
8
today
Free
JavaScript: Basic to Advanced · The Event LoopStep 6 of 20

Microtasks vs Macrotasks

  1. ✓
  2. ✓
  3. ✓
  4. ✓
  5. ✓
  6. 6
  7. 7
  8. 8
  9. 9
console.log('Click received');setTimeout(() => console.log('Analytics sent'), 0);Promise.resolve().then(() => console.log('Cart badge updated'));console.log('Handler finished');

Microtasks

cart badge callback

Tasks

analytics callback

Console

Click received

Real output: Click received, Handler finished, Cart badge updated, Analytics sent

How every topic works

The same five steps in every course, so you always know what comes next.

  1. Read

    Short steps in easy English, with real examples like a shop cart or a chat app.

  2. Watch

    Step-through animations show what the code does, line by line.

  3. Predict

    Guess the output before you run it. The real result checks your answer.

  4. Code

    Write the code in the editor. Tests run in your browser and tell you what passed.

  5. Interview

    Answer the questions interviewers really ask, then compare with a model answer.

You won't be learning alone

Join 7 learners. 8 were here this month.

Shown with their permission. You can turn it off for yourself in Settings.

  • Kushal
  • ranjeet-programmers
  • Ravindra
  • BAKA-BOT106
  • ivinoop
  • sanjivh559-boop
  • Pushpendra

Practise in your own editor

Backend work happens in a real repo, so many of the tasks in Node.js: Basic to Advanced and Express & REST APIs with TypeScript are done with Git, the way you'll work on the job.

  1. Connect GitHub

    DevTrail makes a practice repo on your account, with tests for every task.

  2. Start a task branch

    Each task has its own branch, so your work stays separate.

  3. Code in your editor

    VS Code, Vim, anything. Run the tests locally while you work.

  4. Push to finish

    Tests run before the push. When it reaches GitHub, the task is marked done.

Terminal

git clone https://github.com/you/node-track.gitnpm installgit switch -c task/node-hellowrite the code, thennpm run task -- node-hellogit push -u origin task/node-hello
Pushed. The task is marked done in DevTrail.

What you get

  • Code that is checked on the page

    JavaScript, TypeScript, Python, SQL and React run in your browser. You see which tests passed and why.

  • Real repos for backend work

    Node.js and Express tasks live in your own GitHub repo. Push from your editor and the task is marked done.

  • Animations that show the hard parts

    The event loop, promises, React rendering and more, one frame at a time.

  • Interview questions in every topic

    Plus full interview-prep courses and a final mock interview.

  • Streaks, XP and badges

    A daily goal and a leaderboard to keep you going, never in your way while you study.

  • Your progress is never lost

    Saved on your device and synced to your account when you sign in with GitHub.

Questions

Is DevTrail free?

Yes. DevTrail is free to use today. You only need a GitHub account to sign in.

Do I need to install anything?

Not for most courses: JavaScript, TypeScript, Python, SQL and React code runs and is checked right in your browser. The Node.js and Express editor tasks are the exception: you work on your own computer with Node.js and Git.

Can I use my own editor?

Yes, for editor tasks. DevTrail makes a practice repo on your GitHub account. You clone it, start a task branch, write the code in any editor and push. Tests run before the push, and the task is marked done when it reaches GitHub.

I am a complete beginner. Where do I start?

Start with JavaScript: Basic to Advanced. It begins with your first variable and explains every new word.

Will this help me in interviews?

Every topic ends with real interview questions and model answers, and there are interview-prep courses with a final mock interview.

What happens to my progress?

It is saved on your device as you learn, and synced to your account when you sign in with GitHub, so you can continue on another device.

Start your first topic in under a minute.

Sign in with GitHub and you land on your dashboard, ready to go.

Start learning with GitHub →