2 - JavaScript Variables | JavaScript Tutorial for Beginners

Published: 28 May 2020
on channel: GoPHP
1,129
24

How do you add JavaScript to your page?
By using script tag.

Script tags can be placed in the body, or in the head section of an HTML page, or in both.

JavaScript output statements:
innerHTML | document.write() | window.alert() or alert() | console.log()

JavaScript Variables:
By using var keyword, we can declare variables.
A JavaScript variable can hold any type of data like numbers, strings, boolean etc..

Variable name declaration rules:
Names Contain letters, digits, underscores, and dollar signs.
Names must begin with a letter
Names can also begin with $ and _ (but we will not use it in this tutorial)
Names are case sensitive.
Reserved words (like JavaScript keywords) cannot be used as names

examples of valid variables
var institute = 'Gophp';
var city = 'Hyderabad';
var pincode = 500038
var price = 789.58;
var status = true;


On this page of the site you can watch the video online 2 - JavaScript Variables | JavaScript Tutorial for Beginners with a duration of hours minute second in good quality, which was uploaded by the user GoPHP 28 May 2020, share the link with friends and acquaintances, this video has already been watched 1,129 times on youtube and it was liked by 24 viewers. Enjoy your viewing!