SkillRary

Please login to post comment

JavaScript and its Uses

  • Amruta Bhaskar
  • Dec 17, 2020
  • 0 comment(s)
  • 1789 Views

 

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.

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 colours 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.

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 button is clicked and then run the code that updates the text label.

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.

JavaScript is mainly used for web-based applications and web browsers. But JavaScript is also used beyond the Web in software, servers and embedded hardware controls. Here are some basic things JavaScript is used for:

1.     Adding interactive behaviour to web pages

JavaScript allows users to interact with web pages. There are almost no limits to the things you can do with JavaScript on a web page – these are just a few examples:

  • Show or hide more information with the click of a button
  • Change the colour of a button when the mouse hovers over it
  • Slide through a carousel of images on the homepage
  • Zooming in or zooming out on an image
  • Displaying a timer or count-down on a website
  • Playing audio and video on a web page
  • Displaying animations
  • Using a drop-down hamburger menu

2.     Creating web and mobile apps

Developers can use various JavaScript frameworks for developing and building web and mobile apps. JavaScript frameworks are collections of JavaScript code libraries that provide developers with pre-written code to use for routine programming features and tasks—literally a framework to build websites or web applications around.

Popular JavaScript front-end frameworks include React, React Native, Angular, and Vue. Many companies use Node.js, a JavaScript runtime environment built on Google Chrome’s JavaScript V8 engine. A few famous examples include Paypal, LinkedIn, Netflix, and Uber!

3.     Building web servers and developing server applications

Beyond websites and apps, developers can also use JavaScript to build simple web servers and develop the back-end infrastructure using Node.js.

4.     Game development

You can also use JavaScript to create browser games. These are a great way for beginning developers to practice their JavaScript skills.

Aside from the unlimited possibilities, there are many reasons for web developers to use JavaScript over other programming languages:

  • JavaScript is the only programming language native to the web browser
  • JavaScript is the most popular language
  • There’s a low threshold to get started
  • It’s a fun language to learn

 

Please login to post comment

( 0 ) comment(s)