Tips n Tracks

  • Increase font size
  • Default font size
  • Decrease font size
  • default color
  • black color

Reference

Sample image

Microsoft .NET Framework Get Details.

Sample image

Microsoft .NET Framework Get Details.

Reference

Sample image Microsoft .NET Framework Get Details.
Sample image

Microsoft .NET Framework Get Details.


Learning JavaScript tutorial – JavaScript Literals and Identifiers


Learning JavaScript tutorial – JavaScript Literals and Identifiers

JavaScript Literals

JavaScript Literals are the notation for representing a fixed data value that appears directly in a JavaScript program. JavaScript Literals helps us to assign values (initialize) to various JavaScript Data Types and Variables; such as integers, floating-point numbers, strings, and Booleans; enumerated Data Types and compound values such as arrays, records, and objects.

var intNum = 82    // 82 is a integer literal
var PI = 3.14        // 3.14 is a float literal
var strInfo="This is a string" // this is a string literal
var strGreet=‘Hello!’;   // another string literal
var isMale=true          // A Boolean value literal
var arrAnimal={"cat","dog"}    // array literals

JavaScript Identifiers

JavaScript Identifiers are used to name the JavaScript language entities like variable, object, function and to provide labels for certain loops in JavaScript code. JavaScript Identifiers must start with character followed by subsequent characters can be a letter, a digit, an underscore; Dollar sign ($) also allow. With some versions of JavaScript, dollar signs are not legal in identifiers. The best practice of defining JavaScript Identifiers is to avoid the use of dollar signs. You can’t use JavaScript reserved keywords as a JavaScript Identifiers.

var intNum = 82    // intNum is JavaScript Identifiers
var PI = 3.14        // PI is JavaScript Identifiers
var strInfo="This is a string" // strInfo is JavaScript Identifiers
var strGreet=‘Hello!’;   // strGreet is JavaScript Identifiers
var isMale=true          // isMale is JavaScript Identifiers
var arrAnimal={"cat","dog"}  // arrAnimal is JavaScript Identifiers

 

Chetan love blogging. He regularly blogs at http://www.tipsntracks.com. You can connect with Chetan on Twitter, Facebook and Google Plus...

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

var arrAnimal={“cat”,”dog”} // array literals
That’s actually a malformed Object literal

an Array literal would use square brackets
var arrAnimal=["cat","dog", 1] // array literals

a correctly formed Object literal would have key:value pairs like
var objAnimal={cat:”fluffy”, dog:”spike”} // object literals

Comment by Adam Bankin on May 17, 2010 @ 3:27 am

Leave a comment

(required)

(required)

*
To prove that you're not a bot, enter this code
Anti-Spam Image