3. The History
•Created by Brendan Eich in 10
days
•Released in 1995 as part of
Netscape Navigator 2.0
•First standardised in 1997
•Also know as Mocha, LiveScript,
8. The Awesome
Functional Programming
• Functions are first class
• Incredibly powerful
• Closures / Lambda Calculus
• Callbacks: non-blocking
• Definitely not scripting!
9. The Awesome
Functional Programming
var array = [4, 8, 9, 1, 3, 9];
var weirdArray = (function() {
var newArray = [], i = 0, len = array.length;
for (i = 0; i < len; i += 1) {
newArray.push(array[i] + ‘ tiny monkeys’);
}
return newArray;
}());
console.log(weirdArray); // [‘4 tiny monkeys’, ‘8 tiny monkeys’, ..., ‘9
10. The Awesome
Functional Programming
var go = function (callback) { var logger = function (fn, name) {
var i, array = []; var start = new Date().getTime(),
for (i = 0; i < 2000000; i += log = function () {
1) { var end = new Date().getTime();
array.push(i); return name + ' took ' + (end - start) + '
} milliseconds';
};
return callback();
} return fn(log);
console.log(logger(go, 'go')); // ‘go took 114 milliseconds’
11. The Awesome
Prototypical Inheritance
• Objects without classes
• Powerful enough that it can pretty much emulate
classical inheritance
• Can reduce code significantly if used properly
• Can be a bit confusing at first
12. You Need to Know
• JavaScript is the new bytecode?
• Web apps are the future?
• Thin server-side architectures?
• Can’t be replaced?
• Windows 8
• Multi-processor support
Notes de l'éditeur
\n
\n
\n
\n
- JavaScript: Sounds like a simplified Java. Actually way more powerful.\n- XMLHttp: first in 1999 in IE5, Mozilla 2002, Safari 2004\n