JavaScript

JavaScript

What is JavaScript?

JavaScript is a scripting or programming language that allows you to implement complex features on web pages — every time a web page does more than just sit there and display static information for you to look at — displaying timely content updates, interactive maps, animated 2D/3D graphics, scrolling video jukeboxes, etc. — you can bet that JavaScript is probably involved. It is the third layer of the layer cake of standard web technologies, two of which (HTML and CSS) we have covered in much more detail in other parts of the Learning Area.

  • HTML is the markup language that we use to structure and give meaning to our web content, for example defining paragraphs, headings, and data tables, or embedding images and videos in the page.
  • CSS is a language of style rules that we use to apply styling to our HTML content, for example setting background colors and fonts, and laying out our content in multiple columns.
  • JavaScript is a scripting language that enables you to create dynamically updating content, control multimedia, animate images, and pretty much everything else. (Okay, not everything, but it is amazing what you can achieve with a few lines of JavaScript code.)

The three layers build on top of one another nicely. Let's take a simple text label as an example. We can mark it up using HTML to give it structure and purpose:

So what can it really do?

The core client-side JavaScript language consists of some common programming features that allow you to do things like:

  • Store useful values inside variables. In the above example for instance, we ask for a new name to be entered then store that name in a variable called name.
  • Operations on pieces of text (known as "strings" in programming). In the above example we take the string "Player 1: " and join it to the name variable to create the complete text label, e.g. "Player 1: Chris".
  • Running code in response to certain events occurring on a web page. We used a click event in our example above to detect when the label is clicked and then run the code that updates the text label.
  • And much more!

What is even more exciting however is the functionality built on top of the client-side JavaScript language. So-called Application Programming Interfaces (APIs) provide you with extra superpowers to use in your JavaScript code.

APIs are ready-made sets of code building blocks that allow a developer to implement programs that would otherwise be hard or impossible to implement. They do the same thing for programming that ready-made furniture kits do for home building — it is much easier to take ready-cut panels and screw them together to make a bookshelf than it is to work out the design yourself, go and find the correct wood, cut all the panels to the right size and shape, find the correct-sized screws, and then put them together to make a bookshelf.

To view or add a comment, sign in

More articles by Rijika Roy

  • Oracle

    What is Oracle? Oracle database is a relational database management system (RDBMS) from Oracle Corporation. This…

  • Tableau

    Introduction to Tableau Every day, we encounter data in the amounts of zettabytes and yottabytes! This enormous amount…

  • GCP

    What is Google Cloud Platform (GCP)? Companies turn to the public cloud for various reasons, but it has become the…

  • Oracle

    What is Oracle? Oracle database is a relational database management system (RDBMS) from Oracle Corporation. This…

  • Python Developer

    What is a Python Developer? Though there are many jobs in tech that use Python extensively — including Software…

  • Hadoop

    What is Apache Hadoop? Apache Hadoop software is an open source framework that allows for the distributed storage and…

  • Data Analytics

    What is data analytics? Data analytics converts raw data into actionable insights. It includes a range of tools…

  • MySQL

    What is MySQL? MySQL, the most popular Open Source SQL database management system, is developed, distributed, and…

  • What is Hive?

    Apache Hive is a distributed, fault-tolerant data warehouse system that enables analytics at a massive scale. Hive…

  • JAVA

    What is Java? Java is a widely-used programming language for coding web applications. It has been a popular choice…

Insights from the community

Others also viewed

Explore topics