One Cup of Java(Script), Please

This week was all about JavaScript, and no that isn’t a fancy latte you’ll be be able to find at your local Starbucks. Rather, JavaScript is  “is a scripting or programming language that allows you to implement complex things on web pages — every time a web page does more than just sit there and display static information for you to look at.” This looks like the unfollow/follow feature on Twitter, Google giving you search suggestions while you type, and yes, JavaScript is even responsible for those pop-up ads we adore.

JavaScript is the third layer of website, client-side programming. Combined with HTML & CSS, JavaScript makes webpages dynamic and more interactive. HTML, CSS, and JavaScript are all client-side programming because the language is interpreted by the client — which in most cases is our web browsers. Our web browsers read these languages and then present us with the finished product. The opposite of client-side programming languages are server-side programming languages. Server-side programming languages “deal with dynamic content. It runs on the server. Most web pages are not static since they deal with searching databases.” These programming languages structure web applications, query the database, and encode data into HTML. Examples of server-side programming languages are: PHP, C++, Python, and Java. Yep — sans “Script.”

Practicing JavaScript on Codecademy, I learned that they are three essential data types in this language: strings, numbers, and booleans. Strings are any grouping of words or numbers surrounded by single quotes. Numbers are well… numbers, but we don’t put these in quotes. Lastly, a boolean is either going to be the word true or the word false. These also don’t go in quotes. These are the building blocks of JavaScript, similar to nouns and verbs in our own language. To see what we’re trying to say in JavaScript, we simply use console.log and a pair of parentheses. JavaScript also has some pretty neat math functions. It can do the basics (multiple, divide, add, subtract) and it can even find a modulus. Now, what exactly does that mean? That’s a question better served for Google.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.