Difference between revisions of "Datatypes and variables"

From JSXGraph Wiki
Jump to navigationJump to search
(New page: =Data types= Though JavaScript is a [http://en.wikipedia.org/wiki/Weak_typing weakly typed] programming language, there are some data types between which JavaScript sometimes variables aut...)
 
Line 1: Line 1:
 +
{{JSTuTToC}}
 +
 
=Data types=
 
=Data types=
 
Though JavaScript is a [http://en.wikipedia.org/wiki/Weak_typing weakly typed] programming language, there are some data types between which JavaScript sometimes variables automatically converts:
 
Though JavaScript is a [http://en.wikipedia.org/wiki/Weak_typing weakly typed] programming language, there are some data types between which JavaScript sometimes variables automatically converts:

Revision as of 21:07, 15 July 2009

Introduction to JavaScript
  • Integrate JavaScript on webpages
    • Internal JavaScript
    • External JavaScript
    • Inline JavaScript
  • Datatypes and variables
    • Datatypes overview
    • Variables declaration
  • Arrays
    • Implementation
    • Declaration
    • array as object -> properties and methods
    • Anonymous arrays
    • associative arrays/hashtables
  • Functions
    • Declaration
    • Parameters
    • Default values for parameters and variable length parameter lists
    • return values
    • callback functions
    • anonymous functions
  • Objects
    • Class definition, object initialisation, singletons
    • Prototyping concept and inheritance
    • Anonymous objects
    • Objects as associative arrays


Data types

Though JavaScript is a weakly typed programming language, there are some data types between which JavaScript sometimes variables automatically converts:

null

Null means variable has no value at all. Do not confuse null with 0 (zero)! 0 is just a number, null means just no value or a empty or non-existent reference.

undefined

A value that is undefined is a value held by a variable right after it has been created and before a value has been assigned to it.

boolean

number

string