4. JavaScript
• It's a real programming language!
• Brendan Eich at Netscape invented it
• Web only language - never was
• Often not learned, just used
• ECMAScript5, ECMAScript.next
Mittwoch, 18. Mai 2011
5. Take a guess!
What is JavaScript?
Mittwoch, 18. Mai 2011
26. var o = new Object();
vs.
var o = {};
Mittwoch, 18. Mai 2011
27. var s = new String();
vs.
var s = "";
Mittwoch, 18. Mai 2011
28. var x = "" + y;
x.toLowerCase();
Mittwoch, 18. Mai 2011
29. "By reducing your global footprint to a single
name, you significantly reduce the chance of bad
interactions with other applications, widgets, or
libraries."
Douglas Crockford
Mittwoch, 18. Mai 2011
31. var node = byId("someEl");
node._value = 42;
Mittwoch, 18. Mai 2011
32. var str = s1 + s2 + s3;
vs.
var str = [s1, s2, s3].join("");
Mittwoch, 18. Mai 2011
33. var C = function(name){
this.name = name;
};
C.prototype.say = function(){
console.log(this.name);
};
var obj = new C("Dave");
Mittwoch, 18. Mai 2011