Over the time of creating these blog posts and writing content I don’t think I have gone over what exactly javascript is. I know I have dived in on expounding on my journey of learning it and posting some insights of the fundamentals of the language but I never described what the general makeup of the language.
So I had to make it a priority to give an explanation of what it is, especially from my perspective, and how I am learning the basic programming language of front end web development.
Now without further ado let’s learn what javascript is.
What is Javascript?
There are many books and resources out there that describe what the programming language javascript is, how to use it, and what it is useful for. Yet, as many resources there are out there it took me some time for this information to actually stick in my understanding and how I can use this in my own projects.
However, before I describe what javascript is I think it would be best to describe the basics of what programming is and how javascript plays a role.
What is a program?
A program is a way developers are able to communicate with computers, and when it comes to communicating, as in any culture or language, that requires a common vocabulary that both parties can understand. One of the languages, or vocabulary, that computers understand is called a script. Therefore when it comes to developers communicating to the computer or the program–javascript comes into play.
Now that you know how to communicate to the program we can dive into what javascript is.
Javascript is a programming language that we are able to use to write for websites and web applications. Javascript’s main function is to add interactivity to a web page. Now with the advancement of javascript we as developers are able to do so much more.
But just remember when you think of javascript think of interactivity.Â
So what do you mean by interactivity? Well my fellow developers. Have you ever visited a site and there was some text that told you to press this button and the text would change on the page or a specific element would change color? This engagement means you have experienced a form of javascript. Even though that is a really simplistic example of it nevertheless it used javascript.
fun fact javascript is an object oriented functional language.
What does this mean? I know it sounds quite confusing when you hear it but once I understood this concept everything in javascript started to make sense.
In javascript there is something that is called an object. What an object is basically a table that is made up of names (called keys) and values.
Ex. var person = {
name: “Courey”,
age: 29};
if I was to break this down here is a short table of the object called person
name | Courey |
---|---|
age | 29 |
As you can see, which is really short like I said, it gives a list of attributes that describe the person object and what they equal out to be. These attributes (or data) are known as properties. So the value of the name property is Courey and the value of the age property is 29. Another thing that are apart of objects are known as functions (which are called methods in an object). What methods can be defined as are tasks that can be done to that object.
Once you see that functions/methods deals with everything tied to that object you will have a better time calling on specific properties and methods within the program.
How Javascript Works.
Now that you have a basic understanding of what javascript is telling you how it works and interacts with a website may be a little easier to comprehend. Again, once I understood these simple concepts I felt reading the language was much easier.
Dealing with developing websites we know that to create one you need to write it in HTML and the design of the site is with CSS. Side note I never understood the idea when people say HTML and CSS is not a programming language.
I mean I get it and that your not actually writing programs with it but as a front end web developer you need to learn the code for it which means your a developer but I don’t like to discredit it as not a language. They all have there own syntax and vocabulary and they all play a significant role together.
Anyways I digress.
Now with the foundation of your HTML javascript comes into play because it interacts with the DOM elements to manipulate them. Which leads me to my next subject. Do you remember how I said javascript is an object oriented language? Ok here is how it truly works.
Let’s breakdown what a computer is and how an object works. So an object is really just a representation of something in the real world but it uses data to to represent that. How it represents that data is with its properties and values I mentioned earlier as a table.
Because your computer, more specifically your browser, can be represented by an object of data with properties and values javascript is able to access these properties and methods in order to create interactivity to your website. So because your computer, browser, and your HTML document is represent by data as an object Javascript now has the ability to do whatever you want to the DOM which stands for Document Object Model.
Get it?
You see? Data are what make up objects and javascript is able to access this information and use it. I don’t know about you but once I truly understood the concept of what an object is it truly opened up my mind to the concept of javascript.
A really good book to check out, which I am still reading. or rather rereading. is “Javascript and jQuery” by Jon Duckett. A great book and great resource to go check out. You can also find it in the goodies section of my website : ).
As I mentioned before javascript has evolved over the years and continues to improve. Javascript has now evolved to working with the backend, so now its not just for front end developers. Developers can now use javascript with nodejs to create their own servers and test applications as well as developing apps and sites using ajax. I myself have not dived to deep into nodejs but that is on my to do list in the near future.
It sounds like I may be more than just a front end developer in the future, but I’m looking to make javascript my first love as well as front end because I think I just love that aspect more. It may be the creativity in me as well as seeing the design come to life.
Anyways if I were to describe javascript in its simplest terms I think this is the best approach of how I would describe it now with my understanding.
It just makes sense!
Of course as I continue to develop myself other ways will arise for me as my aim is to get better and better everyday.
So if you find topics like this interesting stay tuned I am making it my goal to learn all what I can of the web and front end web development and to share it.