While in school, I used to write code for pure pleasure or interest. They were really tiny applications with no real-world application. My interest in programming professionally started once I graduated from university. Since then, the first real application that I built from scratch was for my first startup Gharpay. We had to build an order management dashboard for our clients. Post the meeting, I had to come back and google the word "Dashboard". Before that, I had only coded in C and has no idea about web programming. Ruby seemed to be the language du jour for building web applications. So, I
Was it hard? Not really. At first, it was a little frustrating coming to terms with the web paradigms. Soon I got used to thinking along those lines. It was definitely scary when I launched my first "production" application. I was now the master of my own fate.
If you're just starting out, I would highly recommend, you just build something. You can either take an open-source project and add a feature, or find an application that you like (written in another language) and write it in JS (or whichever language you are learning). This helps you chalk out your feature roadmap and you don't need to think about what you need to build.
Alternatively, convince someone to pay you to build an application. The fire a client will light under your ass is the greatest source of inspiration I've ever experienced. :)