What is JavaScript? What Does It Do, and What Is It Used For?

Hi! In this Article we’re goingto answer the question, “What is JavaScript? What does it do and what is it used for?” Well, first of all, right off the bat, Javascript is a programming language. But one of the thingsthat makes it very unique is that it runs right in your browser.

Most programming languagesfor the web run on the server, and then what you get in yourbrowser is a plain webpage. JavaScript’s actually run by your browser and that makes it quite unique in the world of programming languages. We’re here at JavaScript.comand one of their first examples is to simply type your namein quotes and hit enter. And there, when I didthat it turned green, it put a check mark on the left, and it made a button thatsaid “next challenge”.

My browser didn’t go out to the server to get all that information,it just did it right here. So then, what can JavaScript do for us? There’s lots and lots of great things. It’s really good atproviding interactivity. Right here in this blog post, there’s this little gallery of pictures. On some of them if you hover,it pops up a description. And if you click, it fadesthe page out to black and brings up a large one with a space for comments below andarrows on the left and right and a little x here at the top. All kinds of interactivity. Another example ofinteractivity comes right here in this form field. It wants a date.

When I click, it brings up a calendar and I can simply click. That helps remove thepossibility of typing in a date incorrectly. And it helps you be sure aboutthe date you’re choosing. Another thing that JavaScript can enable is real-time content updates. We’re looking here at a Google map and there are littlepinpoints all over it.

If I click one, it bringsup some information. Now JavaScript went out to the server and got this little piece of information. It didn’t actually reload the whole page. If I click on a different pinpoint, it goes to get different information. And then down in the bottom right are some tools for zooming. Each time I zoom it’sgoing out to the server, getting a new image. But it’s doing it withoutreloading the entire browser. So I don’t lose whatever work I’m doing elsewhere in this page. JavaScript can also enable animation.

This is a code example page. We have HTML, CSS and JavaScript. But together they make this solar system. And it’s more than just animation. You can choose different planets to watch. You could turn it into 2D. You could zoom it out so that you could see allof the planets at once. And you can have different focuses.

Right now we’re looking at speed, but if you actually made size proper, this is what the sun islike in scale to Earth, not like this, and there’s also distance. All of this is done with justa little bit of JavaScript. One last thing I want to showyou is dealing with data. You can take data in theproper format and feed it into JavaScript andcreate charts and graphs. These charts and graphs canbe automatically updated based on the data that gets fed into them.

So let’s review. JavaScriptis a programing language. And the thing that makes it unique is that it actually runs in your browser, as opposed to on the server. It can provide interactivity,real-time content updates, and quite a few animation options. JavaScript is an exceptionallypowerful language. One last thing I’d like to point out is that JavaScript is notrelated to Java in any way. The name is an unfortunate coincidence. They’re completelydifferent languages written for different purposes by different people at different times and theyrun on different machines. The thing to remember isthat JavaScript is the one that runs in your browser.

Leave a Comment

Your email address will not be published. Required fields are marked *