- Store proper values inside variables. In the above example, for instance, we ask for a new name to be entered and then store that name in a variable called
- 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
namevariable 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
clickthe event in our example above to detect when the button is clicked and then run the code that updates the text label.
APIs are ready-made code building blocks that allow developers 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. So it is much easier to take ready-cut panels. Screw them together to make a bookshelf, then work out the design yourself.
The Future Of This Language
- Interactivity: One of JS’s core features is its ability to create dynamic interactions on web pages.
- Versatility: With frameworks like React, Angular, and Vue, JS isn’t limited to just websites. It powers everything from mobile apps to desktop applications.
- Active Community: A vast community means many resources, tutorials, and frameworks are available to aid your learning and development journey.