The document is a specification from ECMA International that defines the ECMAScript language. It describes ECMAScript as an object-oriented scripting language intended to be used in web browsers and web servers to perform computations and manipulate objects within a host environment provided by the browser or server. It outlines the core language types, operators, statements and provides examples of how ECMAScript scripts can interact with objects in the browser environment like windows, forms and events.
Presented at Web Unleashed on September 16-17, 2015 in Toronto, Canada
More info at www.fitc.ca/webu
Why TypeScript?
with Jeff Francis
OVERVIEW
TypeScript is a type-checked superset of JavaScript that benefits medium-sized to complex JavaScript projects. Why would you want to learn a new language, instead of another JavaScript framework? You have all this existing JavaScript code, so how can you adopt something new without throwing the old stuff out?
This session is about the benefits of using TypeScript on top of JavaScript in your projects, and demonstrate step by step ways of migrating an existing JavaScript project to TypeScript. We will dive into code generated by the compiler and look at resources and tools that make working in TypeScript a pleasurable experience.
OBJECTIVE
To understand when it’s a good idea to use TypeScript.
TARGET AUDIENCE
JavaScript developers.
ASSUMED AUDIENCE KNOWLEDGE
Intermediate JavaScript experience.
FIVE THINGS AUDIENCE MEMBERS WILL LEARN
The basics of TypeScript – types, classes, modules, and functions
How TypeScript’s design makes getting started simple and helps projects
What compiled TypeScript looks like and how to debug
What tools can help take advantage of TypeScript’s type information
How to migrate a JavaScript project to TypeScript
Not so long ago Microsoft announced a new language trageting on front-end developers. Everybody's reaction was like: Why?!! Is it just Microsoft darting back to Google?!
So, why a new language? JavaScript has its bad parts. Mostly you can avoid them or workaraund. You can emulate class-based OOP style, modules, scoping and even run-time typing. But that is doomed to be clumsy. That's not in the language design. Google has pointed out these flaws, provided a new language and failed. Will the story of TypeScript be any different?
The presentation helps us in understanding the different concepts associated with TypeScript. What is TypeScript? Why is TypeScript used and the different applications of TypeScript. For more information you can simply visit: http://mobile.folio3.com/
Presented at Web Unleashed on September 16-17, 2015 in Toronto, Canada
More info at www.fitc.ca/webu
Why TypeScript?
with Jeff Francis
OVERVIEW
TypeScript is a type-checked superset of JavaScript that benefits medium-sized to complex JavaScript projects. Why would you want to learn a new language, instead of another JavaScript framework? You have all this existing JavaScript code, so how can you adopt something new without throwing the old stuff out?
This session is about the benefits of using TypeScript on top of JavaScript in your projects, and demonstrate step by step ways of migrating an existing JavaScript project to TypeScript. We will dive into code generated by the compiler and look at resources and tools that make working in TypeScript a pleasurable experience.
OBJECTIVE
To understand when it’s a good idea to use TypeScript.
TARGET AUDIENCE
JavaScript developers.
ASSUMED AUDIENCE KNOWLEDGE
Intermediate JavaScript experience.
FIVE THINGS AUDIENCE MEMBERS WILL LEARN
The basics of TypeScript – types, classes, modules, and functions
How TypeScript’s design makes getting started simple and helps projects
What compiled TypeScript looks like and how to debug
What tools can help take advantage of TypeScript’s type information
How to migrate a JavaScript project to TypeScript
Not so long ago Microsoft announced a new language trageting on front-end developers. Everybody's reaction was like: Why?!! Is it just Microsoft darting back to Google?!
So, why a new language? JavaScript has its bad parts. Mostly you can avoid them or workaraund. You can emulate class-based OOP style, modules, scoping and even run-time typing. But that is doomed to be clumsy. That's not in the language design. Google has pointed out these flaws, provided a new language and failed. Will the story of TypeScript be any different?
The presentation helps us in understanding the different concepts associated with TypeScript. What is TypeScript? Why is TypeScript used and the different applications of TypeScript. For more information you can simply visit: http://mobile.folio3.com/
C++11 (formerly known as C++0x) is the new C++ language standard. Dave Abraha...yaevents
Dave Abrahams, BoostPro Computing
He is a founding member of Boost.org and an active participant in the ISO C++ standards committee. His broad range of experience in the computer industry includes shrink-wrap software development, embedded systems design and natural language processing. He has authored eight Boost libraries and has made contributions to numerous others. Dave made his mark on C++ standardization by developing a conceptual framework for understanding exception-safety and applying it to the C++ standard library. He created the first exception-safe standard library implementation and, with Greg Colvin, drafted the proposals that eventually became the standard library’s exception safety guarantees.
Presentation topic:
C++11 (formerly known as C++0x) is the new C++ language standard. Dave Abrahams, BoostPro Computing.
Key points:
The ISO C++ standardization committee has just unanimously approved its final draft international standard, and it's chock full of new features. Though a few of the features have been available for years, some are brand new, and nobody really knows what it's like to program in this new C++ language. As with C++03, Boost.org is expected to take a leading role in exploiting C++11. In this talk, I'll give an overview of the most important new developments.
Inspired by Arno Haases great talk at JAX 2012, I assembled some performance "tipps" and took a look at those. Arno's permission to use the same title as he did in his talk is very much appreciated. Thanks a lot!
- What's new in .NET Platform
- What's new in Visual Studio 2017
- What's new in C# 7.0: out variables, Tuples, Pattern Maching, ref locals and returns, Local Functions, More expression-bodied members, throw Expressions, Generalized async return types, Numeric literal syntax improvements
C++11 (formerly known as C++0x) is the new C++ language standard. Dave Abraha...yaevents
Dave Abrahams, BoostPro Computing
He is a founding member of Boost.org and an active participant in the ISO C++ standards committee. His broad range of experience in the computer industry includes shrink-wrap software development, embedded systems design and natural language processing. He has authored eight Boost libraries and has made contributions to numerous others. Dave made his mark on C++ standardization by developing a conceptual framework for understanding exception-safety and applying it to the C++ standard library. He created the first exception-safe standard library implementation and, with Greg Colvin, drafted the proposals that eventually became the standard library’s exception safety guarantees.
Presentation topic:
C++11 (formerly known as C++0x) is the new C++ language standard. Dave Abrahams, BoostPro Computing.
Key points:
The ISO C++ standardization committee has just unanimously approved its final draft international standard, and it's chock full of new features. Though a few of the features have been available for years, some are brand new, and nobody really knows what it's like to program in this new C++ language. As with C++03, Boost.org is expected to take a leading role in exploiting C++11. In this talk, I'll give an overview of the most important new developments.
Inspired by Arno Haases great talk at JAX 2012, I assembled some performance "tipps" and took a look at those. Arno's permission to use the same title as he did in his talk is very much appreciated. Thanks a lot!
- What's new in .NET Platform
- What's new in Visual Studio 2017
- What's new in C# 7.0: out variables, Tuples, Pattern Maching, ref locals and returns, Local Functions, More expression-bodied members, throw Expressions, Generalized async return types, Numeric literal syntax improvements
A computação ubíqua, muitas vezes conhecida por computaçãoo invisível, diz respeito a um novo campo de pesquisa que estuda a pulverização massiva de tecnologias computacionais no mundo real para construção dos chamados espaços inteligentes, como as casas do futuro onde TV, geladeira e sistema de iluminação se integram. Nestes cenários, através da integração de elementos da computação móvel e pervasiva, todos os elementos físicos e lógicos que compõem o ambiente são conectados entre si para o provimento de serviços ao homem. O objetivo desta apresentação é introduzir os principais conceitos da computação invisível e descrever como a tecnologia Java pode ser usada para viabilização deste conceito que se acredita ser o próximo grande paradigma computacional.
Plano de ensino da disciplina Construção de Software ministrada no Programa de Pós-graduação em Computação Aplicada da Universidade de Brasília entre 13/05 a 08/07/2016.
A discussion on the upcoming new features in ES6 and how they change the way we build applications with JavaScript.
Most Notable Upcoming Changes in EcmaScript 6
Classes: Classes are now first-class citizens in ES6. The language offers support for classes ("class" keyword), constructors ("constructor" keyword) and the "extend" keyword for inheritance.
Modules: Modules provide a much needed way to segment and organize JavaScript applications in logical chunks of code. Many frameworks already provide ways to modularize large apps, but standardizing a common module structure will bring a level of interoperability between various JavaScript libraries.
Block Scoping: Scoping in JavaScript can be a confusing topic for programmers coming from more traditional Object-Oriented languages such as Java or C#. There are basically two scopes in JavaScript: global and function. Until now. With the help of the "let" keyword, ES6 enables the definition of block scopes for variables and functions.
Default Parameters: A liked feature of many other languages such as Ruby, the default parameters save endless checking of they've been passed and if they are "undefined".
Enhanced Object Literals: There is now a handy expression for property: property assignments and methods can be defined without the "function" keyword.
Sperasoft talks about several important aspects of ECMAScript6 - language widely used for client-side scripting on the web, in the form of several well-known implementations such as JavaScript, JScript and ActionScript.
Game Design and Development Workshop Day 1Troy Miles
This course teaches you how to build awesome video games using Cocos2Dx. Cocos2Dx is a feature packed, free game development engine. It is cross platform, high performance, and supports three languages: C++, Lua and JavaScript. With it, you can write games for iOS, Android, Windows, Mac, and the Web. It is nothing short of amazing and this course teaches you how to use it. We will program Cocos2Dx in JavaScript, but this is not a programming class. If you don't know how to write code in JavaScript or some other curly brace language, this is not the course for you. For those whose JavaScript is rusty, we will do quick language overview. Don't let the JavaScript part fool you. Cocos2Dx is built from highly optimized C++ and OpenGL, JavaScript is used for game logic, not graphics. Our games will run at a super fast, 60 frames a second.
Apresentação da disciplina Construção de Software apresentada no Mestrado em Computação Aplicada da Universidade de Brasília no 1º semestre de 2014. https://matriculaweb.unb.br/matriculaweb/posgraduacao/oferta_dados.aspx?cod=301906
Os modelos mentais atualmente difundidos em muito se relacionam com a insustentabilidade sócio-econômica de vários setores. Herdadas da revolução industrial, as formas de trabalho consolidadas por filosofias de comando e controle e processos em estilo linha de montagem não são compatíveis com a atual economia do conhecimento. Na computação, métodos tradicionais de desenvolvimento de software têm sido duramente criticados por sua incompatibilidade às necessidades criativas e dinâmicas do setor. Neste sentido, o Manifesto 2.0 é um grito em favor a uma nova escola de pensamento, gerida por valores em favor da agilidade, qualidade de vida, da sustentabilidade econômica e social, da criatividade, liderança, criatividade e motivação. Através da análise de comportamentos modernos, apresentaremos esta nova escola do pensamento, comparando costumes obsoletos com tendências 2.0 e refletindo sobre o cenário da TI nos próximos anos.
Material (incompleto) das aulas de Struts 2.x ministradas no curso de especialização em Sistemas Orientados a Objetos da Universidade Católica de Brasília.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
GridMate - End to end testing is a critical piece to ensure quality and avoid...ThomasParaiso2
End to end testing is a critical piece to ensure quality and avoid regressions. In this session, we share our journey building an E2E testing pipeline for GridMate components (LWC and Aura) using Cypress, JSForce, FakerJS…
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
17. ISO IEC
16262
http://www.ecma-international.org/publications/standards/Ecma-262.htm
18. “ ECMAScript is an
object-oriented
programming
language for performing
computations and manipulating
computational objects within
a host environment.
ECMAScript Language Specification
5th edition (December 2009)
19. “ ECMAScript as defined here
is not intended to be
computationally self-
sufficient; indeed, there are no
provisions in this specification for
input of external data or output of
computed results.
ECMAScript Language Specification
5th edition (December 2009)
20. “ Instead, it is expected that
the computational environment
(host environment)
of an ECMAScript program will
provide not only the objects and
other facilities described in this
specification but also certain
environment-specific host
objects
ECMAScript Language Specification
5th edition (December 2009)
21. “ Some of the facilities of
ECMAScript are similar to those
used in other programming
languages; in particular Java TM,
Self, and Scheme
ECMAScript Language Specification
5th edition (December 2009)
22. “ A web browser provides an ECMAScript host
environment for client-side computation
including, for instance, objects that
represent windows, menus, pop-ups,
dialog boxes, text areas, anchors, frames,
history, cookies, and input/output.
navigator.appName;
window.moveTo(100,100);
ECMAScript Language Specification
5th edition (December 2009)
23. “ Further, the host environment provides a
means to attach scripting code to events such
as change of focus, page and image
loading, unloading, error and abort,
selection, form submission, and mouse
actions.
<button type="button" onclick="displayDate()">
Display Date
</button>
ECMAScript Language Specification
5th edition (December 2009)
24. “ The scripting code is reactive
to user interaction and
there is no need for a main program.
<!-- Ate parece, mas nao e o ‘main’ do javascript -->
<script type="text/javascript">
function load() {
alert("Page is loaded");
}
</script>
<body onload="load()">
ECMAScript Language Specification
5th edition (December 2009)
25. “ A web server provides a different
host environment for server-side
computation including objects
representing requests, clients,
and files; and mechanisms to
lock and share data.
ECMAScript Language Specification
5th edition (December 2009)
26. “ Each Web browser and server that
supports ECMAScript supplies
its own host environment,
completing the ECMAScript
execution environment.
ECMAScript Language Specification
5th edition (December 2009)
27. “ ECMAScript is an object-oriented
programming language
(...)
ECMAScript Language Specification
5th edition (December 2009)
28. “ ECMAScript is an object-oriented
programming language
(...)
Tipos Boolean, Number, String, Array, RegExp
Operadores + - * / >> << >>> < > <= >= | & *= ^ ++
Comentários // /* */
Estruturas do while for if else try catch switch
ECMAScript Language Specification
5th edition (December 2009)
29. Tipos
(construtores)
Boolean Object
Number Function
String RegExp
Array Date
30. Tipos
undefined
var x;
alert(x);
ECMAScript Language Specification
5th edition (December 2009)
31. Tipos
null
var x = null;
alert(x);
ECMAScript Language Specification
5th edition (December 2009)
32. Tipos
Boolean
var x = true;
if(x) {
alert('Verdadeiro');
}
Obs: 0 e null equivalem a false
ECMAScript Language Specification
5th edition (December 2009)
33. Tipos
Number
var x = 10;
var y = 15;
alert(x+y);
var x = 10.1;
var y = 15.2;
alert(x+y);
ECMAScript Language Specification
5th edition (December 2009)
34. Tipos
String
var x = “Alexandre”;
alert(x);
ECMAScript Language Specification
5th edition (December 2009)
35. Tipos
Function
var x = function() { alert("Alexandre"); };
x();
ECMAScript Language Specification
5th edition (December 2009)
36. > var x = true;
> x.constructor;
Boolean()
> var x = "Alexandre";
> x.constructor;
String()
> var x = 3467;
> x.constructor;
Number()
> var x = function() { alert("Alexandre"); };
> x.constructor;
Function()
37. var x = new Boolean(true);
if(x) { alert('Verdadeiro'); }
var x = new String(“Alexandre”);
alert(x);
var x = new Number(10);
var y = new Number(15);
alert(x+y);
39. Operadores
delete
var a = 1
undefined
a
1
delete a
true
a
ReferenceError: a is not defined
ECMAScript Language Specification
5th edition (December 2009)
41. Operadores
++ e --
var a = 1
undefined
a++
1
a
2
++a
3
ECMAScript Language Specification
5th edition (December 2009)
42. Operadores
instanceof
var a = "alexandre"
undefined
a instanceof String
false
var a = new String("alexandre")
undefined
a instanceof String
true
a instanceof Object
true
ECMAScript Language Specification
5th edition (December 2009)
44. Estruturas
if/else continue switch
do/while break throw
while return try/catch
for with debugger
for/in
45. Estruturas
if/else
var a = true
if (a) {
alert('Verdadeiro')
} else {
alert('Falso')
}
ECMAScript Language Specification
5th edition (December 2009)
46. Estruturas
do/while
var i = 1
do {
alert(i); (...)
i++;
} while (i < 5)
ECMAScript Language Specification
5th edition (December 2009)
47. Estruturas
for
for ( var i = 1; i < 5; i++) {
alert(i);
}
(...)
ECMAScript Language Specification
5th edition (December 2009)
48. Estruturas
for/in
var array = [1,3,5,7,9]
for (var i in array) {
alert(array[i])
}
(...)
ECMAScript Language Specification
5th edition (December 2009)
49. Estruturas
for/each/in
> var obj = { a: 1, b: 3, c: 5 }
> obj.a
1
> for(p in obj) {
alert(p + ": " + obj[p])
}
> for each (v in obj) {
alert(v) // v aqui igual ao obj[p] acima
}
ECMAScript Language Specification
5th edition (December 2009)
51. Estruturas
switch/case
var a = "alexandre";
switch (a) {
case "sebastiao":
alert("Tião?");
break;
case "raimunda":
alert("Raimundinha?");
break;
case "alexandre":
alert("Alê!");
break;
}
ECMAScript Language Specification
5th edition (December 2009)
52. “ ECMAScript is object-based: basic
language and host facilities are provided by
objects, and an ECMAScript program is a
cluster of communicating objects.
ECMAScript Language Specification
5th edition (December 2009)
53. Numa aplicação Javascript, coexistirão
3 grupos de objetos
objetos definidos pela objetos definidos pelo objetos definidos pelo
especificação web browser desenvolvedor
ECMAScript
Boolean window alexandre
Number document mensagem
String XMLHttpRequest ...
Array ...
...
54. “ An ECMAScript object is a
collection of properties
each with zero or more attributes
that determine how each property can be used
alexandre
nome: “Alexandre”
sobrenome: “Gomes”
idade: 34
ECMAScript Language Specification
5th edition (December 2009)
55. “ An ECMAScript object is a
collection of properties
each with zero or more attributes
that determine how each property can be used
alexandre
nome: “Alexandre”
sobrenome: “Gomes”
idade: 34
modificável: false
ECMAScript Language Specification
5th edition (December 2009)
57. “ Properties are containers (slots) that hold
other objects, primitive values, or
functions.
alexandre
nome: “Alexandre”
nascimento: new Date(1977,8,8,0,0,0,0)
idade: function() { ... }
ECMAScript Language Specification
5th edition (December 2009)
58. “ ECMAScript defines a
collection of built-in objects
Function, Array, String, Boolean, Number, Math, Date, RegExp, JSON
Error, EvalError, RangeError, ReferenceError,
SyntaxError, TypeError e URIError
ECMAScript Language Specification
5th edition (December 2009)
59. > var x = "Alexandre";
> x.length
String
9
> x.charAt(5);
"n"
> x + " Gomes"
"Alexandre Gomes"
> x.replace("dre", "dro");
"Alexandro"
> x.big()
"<big>Alexandre</big>"
> x.link("http://alegom.es")
"<a href="http://alegom.es">Alexandre</a>"
60. Boolean
>>> var x = true;
>>> if(x) { alert('yes'); } else { alert('no') } // yes
>>> !x
false
>>> x & false
0
>>> x && false
false
>>> x | false
1
>>> x || false
true
>>> var x = false;
>>> if(x) { alert('yes'); } else { alert('no') } // no
61. Number
>>> var x = 10
>>> var y = 15;
>>> z = x + y
25
>>> z.toFixed(2);
"25.00"
>>> z.toExponential(2);
"2.50e+1"
>>> 2.toExponential(2);
SyntaxError: identifier starts immediately
after numeric literal
63. >>> var x = new Date(); Date
>>> x.toString();
"Sun Apr 03 2011 12:20:42 GMT-0300 (BRT)"
>>> x.getHours() + ":" + x.getMinutes() + ":" + x.getSeconds();
"12:20:42"
>>> x.getDate() + "/" + x.getMonth() + "/" + x.getFullYear();
"3/3/2011"
>>> var x = new Date("5/18/2006");
>>> x.toString();
"Thu May 18 2006 00:00:00 GMT-0300 (BRT)"
>>> var x = new Date("2006-5-18");
>>> x.toString();
"Invalid Date"
>>> var x = Date(2006,5,18,10,11,12,13);
>>> x.toString();
"Sun Jun 18 2006 10:11:12 GMT-0300 (BRT)"
64. >>> var x = new Date();
>>> x.toString();
Date
"Sun Apr 03 2011 12:20:42 GMT-0300 (BRT)"
>>> x.getHours() + ":" + x.getMinutes() + ":" + x.getSeconds();
"12:20:42"
>>> x.getDate() + "/" + x.getMonth() + "/" + x.getFullYear();
"3/3/2011"
>>> var x = new Date("5/18/2006");
>>> x.toString();
"Thu May 18 2006 00:00:00 GMT-0300 (BRT)"
>>> var x = new Date("2006-5-18");
>>> x.toString();
"Invalid Date"
>>> var x = Date(2006,5,18,10,11,12,13);
>>> x.toString();
"Sun Jun 18 2006 10:11:12 GMT-0300 (BRT)"
65. >>> var texto = "O gato roeu a roupa do rei de roma";
>>> var regex = new RegExp("gato", “”);
>>> texto.match(regex);
["gato"]
Regex
>>> regex.exec(texto);
["gato"]
>>> texto.match(/gato/);
["gato"]
>>> texto.match(/O gato/);
["O gato"]
>>> texto.match(/o gato/);
null
>>> texto.match(/o gato/i);
["O gato"]
>>> texto.match(/o gato.*/i);
["O gato roeu a roupa do rei de roma"]
78. “ apesar de ser OO,
ECMAScript does not use
classes such as those in C+
+, Smalltalk, or Java.
ECMAScript Language Specification
5th edition (December 2009)
79. “Classful” “Classless”
reuso por herança de reuso por clonagem
classes de objetos
Pessoa joao
nome nome: “João”
sexo idade: 28
<<herda>> <<clona>>
Funcionári maria
o
salário nome: “Maria”
idade: 20
80. “Classful” “Classless”
modelagem modelagem
top-down bottom-up
primeiro a taxonomia e primeiro o
seus relacionamentos... comportamento...
81. “Classful” “Classless”
objetos criados a objetos criados a
partir de classes partir de clonagem...
hoje = new Date() hoje = new Date()
...ou por ‘geração
expontânea’
var x = {
one: 1,
two: 2
}
82. “Classful” “Classless”
objetos carregam a objetos carregam as
estrutura e o características de
comportamento
de sua classe seu protótipo
86. Programação baseada em
protótipos
>>> var conta = { saldo: 1000.00 };
>>> conta.saldo
1000
>>> conta.limite
undefined
>>> var conta_especial = { limite: 500.00 }
>>> conta_especial.limite
500
>>> conta_especial.saldo
undefined
>>> conta_especial.__proto__ = conta // referência explícita
Object { saldo=1000}
>>> conta_especial.saldo
1000
87. Herança baseada em
protótipos
> var conta = function(saldo) {
this.saldo = saldo;
this.ver_saldo = function() {
alert('saldo = ' + this.saldo)
}
}
> c1 = new conta(1000)
> c1.ver_saldo()
> var conta_especial = function(saldo, limite) {
this.inheritFrom = conta;
this.inheritFrom();
this.saldo = saldo;
this.limite = limite;
}
> c2 = new conta_especial(2000,3000)
> c2.ver_saldo()
88. “ objects may be created in
various ways including
via a literal notation
var conta = { saldo: 1000.00 }
ECMAScript Language Specification
5th edition (December 2009)
89. “ objects may be created in
various ways including
via a literal notation
var conta = { saldo: 1000.00 }
or via constructors
hoje = new Date()
ECMAScript Language Specification
5th edition (December 2009)
90. “ Each constructor
is a function
hoje = new Date()
function Date() {
...
}
ECMAScript Language Specification
5th edition (December 2009)
91. mas
function é também um
objeto
Date()
var Date = function() {
...
}
hoje = new Date()
94. “ Each constructor is a
function that has a property
named “prototype” that
is used to implement
prototype-based inheritance
and shared properties.
ECMAScript Language Specification
5th edition (December 2009)
95. “ Each constructor is a function that has a
property named “prototype”(...)
Date()
<<construtor
prototype
Protótipo
do Date()
ECMAScript Language Specification
5th edition (December 2009)
97. “ Every object created by a constructor
Date()
<<construtor hoje = new Date() hoje
prototype
Protótipo
do Date()
ECMAScript Language Specification
5th edition (December 2009)
98. “ Every object created by a constructor
has an implicit reference (called the object’s prototype)
Date()
<<construtor hoje = new Date() hoje
prototype prototype
Protótipo
do Date()
ECMAScript Language Specification
5th edition (December 2009)
99. “ Every object created by a constructor
has an implicit reference (called the object’s prototype)
to the value of its constructor’s “prototype” property.
Date()
<<construtor hoje = new Date() hoje
prototype prototype
Protótipo
do Date()
ECMAScript Language Specification
5th edition (December 2009)
100. “ Furthermore, a prototype may have a
non-null implicit reference to its
prototype, and so on; this is called the
prototype chain.
Date()
<<construtor
Protótipo
do Date()
ECMAScript Language Specification
5th edition (December 2009)
101. “ Furthermore, a prototype may have a
non-null implicit reference to its
prototype, and so on; this is called the
prototype chain.
Date()
<<construtor Protótipo do
protótipo do
Date()
Protótipo do
Protótipo protótipo do
do Date() protótipo do
Date()
ECMAScript Language Specification
5th edition (December 2009)
102. “ When a reference is made to a property in
an object, that reference is to the
property of that name in the first object
in the prototype chain that contains a
property of that name.
ECMAScript Language Specification
5th edition (December 2009)
103. “ When a reference is made to a property in
an object, that reference is to the
property of that name in the first object
in the prototype chain that contains a
property of that name.
obj
p3:
p1: “um” “tres”
p2: p4:
“dois” “quatro”
ECMAScript Language Specification
5th edition (December 2009)
104. “ When a reference is made to a property in
an object, that reference is to the
property of that name in the first object
in the prototype chain that contains a
property of that name.
obj obj.p1
p3:
p1: “um” “tres”
p2: p4:
“dois” “quatro”
ECMAScript Language Specification
5th edition (December 2009)
105. “ When a reference is made to a property in
an object, that reference is to the
property of that name in the first object
in the prototype chain that contains a
property of that name.
obj obj.p1
p3:
p1: “um” “tres” obj.p2
p2: p4:
“dois” “quatro”
ECMAScript Language Specification
5th edition (December 2009)
106. “ When a reference is made to a property in
an object, that reference is to the
property of that name in the first object
in the prototype chain that contains a
property of that name.
obj obj.p1
p3:
p1: “um” “tres” obj.p2
obj.p3
p2: p4:
“dois” “quatro”
ECMAScript Language Specification
5th edition (December 2009)
107. “ When a reference is made to a property in
an object, that reference is to the
property of that name in the first object
in the prototype chain that contains a
property of that name.
obj obj.p1
p3:
p1: “um” “tres” obj.p2
obj.p3
p2: p4:
obj.p4
“dois” “quatro”
ECMAScript Language Specification
5th edition (December 2009)
108. > var Pessoa = function(nome, idade) {
this.nome = nome;
this.idade = idade;
}
> var alexandre = new Pessoa('Ale', 33);
> alexandre.nome
"Ale"
> alexandre.idade
33
> var sebastiana = new Pessoa('Sebastiana', 88);
> sebastiana.nome
"Sebastiana"
> sebastiana.idade
88
109. > var Pessoa = function(nome, idade) {
this.nome = nome;
this.idade = idade;
} construtor
> var alexandre = new Pessoa('Ale', 33);
> alexandre.nome
"Ale"
> alexandre.idade
33
> var sebastiana = new Pessoa('Sebastiana', 88);
> sebastiana.nome
"Sebastiana"
> sebastiana.idade
88
110. > var Pessoa = function(nome, idade) {
this.nome = nome;
this.idade = idade;
}
> var alexandre = new Pessoa('Ale', 33);
> alexandre.nome
"Ale"
> alexandre.idade
33 objeto 1
> var sebastiana = new Pessoa('Sebastiana', 88);
> sebastiana.nome
"Sebastiana"
> sebastiana.idade
88
111. > var Pessoa = function(nome, idade) {
this.nome = nome;
this.idade = idade;
}
> var alexandre = new Pessoa('Ale', 33);
> alexandre.nome
"Ale"
> alexandre.idade
33
> var sebastiana = new Pessoa('Sebastiana', 88);
> sebastiana.nome
"Sebastiana"
> sebastiana.idade
88 objeto 2
163. Node's goal is to provide an
easy way to build scalable
network programs.
http://nodejs.org/
164.
165.
166.
167.
168. Backbone supplies structure to JavaScript-heavy
applications by providing models with key-value
binding and custom events, collections with a rich
API of enumerable functions, views with declarative
event handling, and connects it all to your existing
application over a RESTful JSON interface.
http://documentcloud.github.com/backbone/
169. CoffeeScript is a little language
that compiles into JavaScript. (...)
CoffeeScript is an attempt to
expose the good parts of
JavaScript in a simple way.
http://jashkenas.github.com/coffee-script/