Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.


JavaScript is among the most powerful and flexible programming languages of the web (Java and JavaScript are totally different languages, don't get confused).

We can make dynamic HTML using JavaScript, Even it supports CSS as well.

  • How to define a variable ?

Strings are a primitive(from the start have been used) data type. They are any grouping of characters (letters, spaces, numbers, or symbols) surrounded by single quotes ' or double quotes ".

var university = "Virtual University of Pakistan"
var is a keyword, university is a string type variable.
We can write it in single quotes as well, there is not any difference
var university = 'Virtual University of Pakistan'

while var has been available in JavaScript since its initial release, let and const are only available in ES6 (ES2015) and up.

let university = "Virtual University of Pakistan"
const university = "Virtual University of Pakistan" 
const
is not for variables; it's for constant values which may not be stored anywhere.

var keyword, which defines a variable globally or locally to an entire function regardless of block scope{....}. But let and Const are limited in the scope to the block {....}

Views: 59

Comment

You need to be a member of Virtual University of Pakistan to add comments!

Join Virtual University of Pakistan

Looking For Something? Search Below

VIP Member Badge & Others

How to Get This Badge at Your Profile DP

------------------------------------

Management: Admins ::: Moderators

Other Awards Badges List Moderators Group

Latest Activity

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service