An Introduction to JavaScript

·

1 min read

An Introduction to JavaScript

JavaScript is used to add interactivity and functionalities to websites. It is a programming language and it runs in the web browser. Java script allows you t add functionality to the web page. You can build things like interactive forms and image slides in Javascript.

JavaScript Syntax

JavaScipt is written between the script tags, <script></script>.

console.log() allows you to display to print out output in your browser console. So, to write your first line of javascript.

console.log("Have a lovely day");

Congratulations! You have written your first line of Javascript. This code will simply print, "Have a lovely day" to our console.

Variables

In JavaScript, variables help us hold values. They act like a body where information can be saved. They help us store values, so we can retrieve them later. Variables hold data types such as numbers, strings, and booleans etc.

There is a lot more to learn, and this just the beginning.

..