php-mysql tutorial

Designed By NISHANT GUPTA

  • Home
  • PHP
  • HTML
  • CSS
  • JavaScript
  • JQuery
  • Contact-us
  • Learn HTML

    • Introduction of HTML
    • Image Handling in HTML
    • List Handling in HTML
    • Font Handling in HTML
    • Table Handling in HTML
    • Form Handling in HTML
  • Learn CSS

    • Introduction of CSS
    • Styling Background in CSS
    • Styling Text in CSS
    • Styling Font in CSS
    • Styling Link in CSS
    • Styling List in CSS
    • Styling Table in CSS
    • Styling Div in CSS
    • Styling Span in CSS
    • Positioning in CSS
    • Display in CSS
  • Learn JavaScript

    • Introduction of JavaScript
    • Data Type in JavaScript
    • Variable in JavaScript
    • Oprator in JavaScript
    • Cond. Statement in JavaScript
    • Loop in JavaScript
    • Array in JavaScript
    • Function in JavaScript
    • Date in JavaScript
    • String in JavaScript
    • DOM in JavaScript
    • Event Handling in JavaScript
    • Form Handling in JavaScript
  • Learn PHP-MYSQL

    • Introduction of PHP
    • Decision Control in PHP
    • Loop in PHP
    • Array in PHP
    • Function in PHP
    • Form Handling in PHP
    • File Inclusion in PHP

Data Type in JavaScript

Data Types
  • As far as data types are concerned JavaScript provides us 3 basic data types which are chosen based on the value assigned to the variable.
  • These 3 data types are:
  1. String
  2. Number
  3. Boolean

String Data Type

  1. A String is just a combination of words including nos.
  2. Any type of character can be stored in a string.
  3. It is enclosed in “    “  or ‘     ‘ .
For Example

var myName=“Nishant”;

OR

var myName=‘Nishant’;

Printing Double Quotess
To print double quoted string we have 2 ways:
 
For Example
a. var msg=“  \”Hello\”   “;

OR

b. var msg=‘  “Hello”  ‘;
Number Data Type
Numbers in JavaScript are just numbers , no integers and no floats , just plain numbers
For Example

var salary=40000;

var pie=3.14;

var phoneBill=2000;

 
Boolean Data Type
Booleans can only have two values: true or false.
 
For Example

var x=true;
var y=false;

Booleans are often used in conditional testing.
 

// declaring one javascript variable

var firstName;

// declaring multiple javascript variables

var firstName, lastName;

// declaring and assigning one javascript variable

var firstName = ‘Nishant’;

// declaring and assigning multiple javascript variables

var firstName = ‘Sachin’, lastName = ‘Gupta’;

Variables Decl Rules

  1. Variable names must begin with a letter and can have digits also.
  2. Variable names can also begin with $ and _
  3. Variable names are case sensitive
    Default value of a variable is “undefined”

Advertisements

 

©  2014 All Rights Reserved  •  Design by >Nishant Gupta.

Privacy Policy • Terms of Use