Dojo Dijit and HTML5 in Real world applications/University/2. Advanced Java script I: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 10: | Line 10: | ||
==Objects vs. Arrays== | ==Objects vs. Arrays== | ||
JavaScript is object oriented | JavaScript is object oriented. All variables are objects. Even Arrays are objects. Objects may be defined in three different ways: | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
Line 16: | Line 16: | ||
</script> | </script> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[http://dreaminginjavascript.wordpress.com/2008/06/27/how-weird-are-javascript-arrays/ How Weird are JavaScript Arrays?] | |||
Revision as of 02:48, 23 March 2012
!!! Not released for use yet !!! This is the second lesson on the HTML5, CSS3 and Advanced Javascript course.
2. Advanced Java script I
The first part of the lecture is based on the objects and arrays examples.
Objects and arrays
JavaScript is a class-less programming language. However, yet Object Oriented Programming (OOP) is widely used in JavaScript. The following provide an insight to the way to make OOP in JavaScript.
Objects vs. Arrays
JavaScript is object oriented. All variables are objects. Even Arrays are objects. Objects may be defined in three different ways:
<script type="text/javascript">
</script>
How Weird are JavaScript Arrays?
References
- All examples used in this lecture may tried out and found in the index
- Objects and arrays: Constructor; Prototype; Differential Inheritance; Reflection.
- First class functions: Dojo; Ajax; JSON;
- Last official HTML5 draft: W3C Editor’s Draft 23 March 2009
- W3C HTML5 working draft
- Java Script specification (Ecma script)
- JavaScript language supports First-class function
- Anonymous function
- Other Java Script libraries
- JSON validator jsonlint.com
Document History
Version | Date | Author | Status | Purpose of update |
---|---|---|---|---|
1 | 14 Feb 2012 | PSA | Draft | Not released. |
2 | 22 Mar 2012 | PSA | Draft | Not released |